- Home /
Question by
test84 · Sep 10, 2013 at 01:59 PM ·
gameobjectpositionparentchild
Find position of the GameObject this script is attached to.
Hi,
How can I find position of the GameObject a script is attached to?
Thanks.
Comment
Answer by AlfredDuler · Sep 10, 2013 at 02:06 PM
function Update()
{
Debug.Log (gameObject.transform.position);
}
Answer by Superwayne · Sep 10, 2013 at 02:06 PM
You mean the like you have a cube with a script and in this script you wanna use the position of the cube? In that case it would just be transform.position. Or did I missunderstood your question?