Answers for "how to set position of gameobject in unity"

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
6

how to get position of gameobject in unity

GameObject.Find("Your_Name_Here").transform.position;
Posted by: Guest on August-04-2020
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 "how to set position of gameobject in unity"

Browse Popular Code Answers by Language