function Update()
{
var playerx = 0 + gameObject.transform.position.x;
var playery = 0 + gameObject.transform.position.y;
var playerz = 0 + gameObject.transform.position.z;
print (playerx + ", " + playery + ", " + playerz);
}
first version
I then looked through the Unity Script Reference and found TransformPoint (http://unity3d.com/support/documentation/ScriptReference/Transform.TransformPoint.html)
function Update()
{
var playerPosition = transform.TransformPoint(Vector3.zero);
print (playerPosition);
}
new version
No comments:
Post a Comment