Answers for "unity c# move object to position"

3

move gameobject to position unity

public Transform target;     
 public float speed;     
 
 void Update() 
 	{         
 	float step = speed * Time.deltaTime;         
    transform.position = Vector3.MoveTowards(transform.position, target.position, step);     
    }
Posted by: Guest on April-24-2021

Code answers related to "unity c# move object to position"

Browse Popular Code Answers by Language