Answers for "How To Get The Global Position of a GameObject in a Variable"

C#
1

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;
}
Posted by: Guest on July-22-2020

Code answers related to "How To Get The Global Position of a GameObject in a Variable"

C# Answers by Framework

Browse Popular Code Answers by Language