Game Development Community

Accessing X and Y values in %worldPos

by Nick Wilson · in Torque Game Builder · 04/13/2006 (9:55 pm) · 2 replies

I've been stumped for a few hours on how to access the X and Y values in the %worldPos variable passed in to the OnMouse callbacks. Is there a function that returns these values or some way to access them(I tried %worldPos.x etc.)? I'm trying to get the x and y values of the coordinate into different variables for use in some calculations. Any help would be appreciated.

#1
04/13/2006 (11:27 pm)
To get the components, use
%compX  = getWord( %vector, 0 );
%compY  = getWord( %vector, 1 );
#2
04/14/2006 (9:37 am)
Thanks Nicolas.