Answers for "unity set gameobject 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
14

unity set position

// To set the position of a gameobject use the following
GameObject.transform.position = new Vector3(x, y, z);
Posted by: Guest on February-22-2020
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 set gameobject position"

Browse Popular Code Answers by Language