Answers for "unity change position of gameobject script"

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
2

how to change the position of a gameobject in c# unity

Vector3 pos = transform.position;
pos.x = 12;
transform.position = pos;
Posted by: Guest on November-23-2020

Code answers related to "unity change position of gameobject script"

Browse Popular Code Answers by Language