What do you want to save?
Add Code snippet
New code examples
-
Other 2022-03-27 12:00:11
unity make raycast ignore object
Transform targetTransform = null; // target assigned in inspector RaycastHit[] hits; // returned hits LayerMask mask = new LayerMask(); // set in inspector - USE LAYER MASK TO FILTER hits = Physics.RaycastAll(transform.position, transform.forward, ma... Add solution -
C# 2022-03-25 10:50:20
unity how to move an object to another object
// 3D transform.position = new Vector3(GameObject.Find("Object").transform.position.x, GameObject.Find("Object").transform.position.y, GameObject.Find("Object").transform.position.z); // 2D transform.position = new Vector2(G... Add solution -
Other 2022-03-24 23:25:02
character controller unity crouch
#pragma strict private var ch : CharacterController; private var startHeight : float; // initial height function Start() { ch = GetComponent(CharacterController); startHeight = ch.height; } function Update() { var newH : float = startHei... Add solution -
Other 2022-03-17 00:45:13
how to make an object move towards another in unity
/// <summary> /// Move 2D sprite towards target /// </summary> /// <param name="target"></param> /// <param name="movementSpeed"></param> private void Move(Vector3 target, float movementSpeed) { ... Add solution -
C# 2022-03-16 13:35:27
The type or namespace name 'Target' could not be found (are you missing a using directive or an assembly reference?)
} public float damage = 100f; // Update is called once per frame void Update () { if (Input.GetButtonDown("Fire1")) { shoot(); } } void shoot() { RaycastHit hit; if (Physics.Raycast(transform.position,transform.forwa... Add solution
Best helpers
Seria Yin
+5
Kyle Smith
+5
JSanchez
+5
Larapsodia
+5
TJG
+5
Sharma Pocso
+5
Wilber82
+5
T-rex
+5
Wayno
+5
Winny
+5
Sikku
+5
AlecPerkey
+5
The Alpha
+5
IQAndreas
+5
TeacherSue
+5