Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

How To Get The Global Position of a GameObject in a Variable

// for unity users only!

// use transform instead of GetComponent<Transform>

void Start()
{
  Vector3 LocalPosition = gameObject.GetComponent<Transform>().position;
  Vector3 GloabalPosition = gameObject.transform.position;
}
 
PREVIOUS NEXT
Tagged: #How #To #Get #The #Global #Position #GameObject #Variable
ADD COMMENT
Topic
Name
5+7 =