Game Development Community

Position values

by Danny Csaky · in Torque Game Engine · 11/21/2005 (1:12 am) · 2 replies

Is there a way of reading the position in seperate parts of an object

if i say

echo(1000.position);

I'll get something like

25 0 38

I know that 25 stands for the X value, is there a way of getting it to return only one of the X Y Z values. instead of all 3?

eg position.x

so that i would get 25 instead of all the values.

#1
11/21/2005 (1:40 am)
Something like..

%posX = getWord(%pos,0);
%posY = getWord(%pos,1);
%posZ = getWord(%pos,2);
#2
11/21/2005 (5:33 am)
GetPosition()/getTransform() are the two script/console methods you are looking for, and Westy demonstrates how to use getWord to get just one of the coordinates above.