Variables used for XY postion?
by Turnstyle Studios · in Torque Game Builder · 05/29/2007 (12:07 am) · 4 replies
Is it possible to use a local variable for an x y position?
like... (I declared the posX and posY values from a dynamic field)
%posX = %this.posX ;
%posY = %this.posY ;
%obj.moveTo( %posX %posY,20, true, true, true, 0.01);
this just spits back a syntax error.
this is how it looks with proper numbers in place of the variables.
%obj.moveTo("30 20", 10, true, true, true, 0.01);
I just want to declare the XY positions "30 20" as variables.
thanks
-Jz
like... (I declared the posX and posY values from a dynamic field)
%posX = %this.posX ;
%posY = %this.posY ;
%obj.moveTo( %posX %posY,20, true, true, true, 0.01);
this just spits back a syntax error.
this is how it looks with proper numbers in place of the variables.
%obj.moveTo("30 20", 10, true, true, true, 0.01);
I just want to declare the XY positions "30 20" as variables.
thanks
-Jz
#2
05/29/2007 (2:30 am)
I'm almost certain you can also do this (but don't quote me on that... you'd have to try, if it doesn't work use Igors suggestion).%obj.moveTo(%posX, %posY, 20, true, true, true, 0.01);
#3
05/29/2007 (8:11 am)
What Igor had should work. Because you are set the %poxX and %posY to the object X,Y pos. I did something like is in the past. When I was move an object to a new object.
#4
05/29/2007 (8:40 am)
You guys rock! thanks so much.
Torque Owner Igor Kuryatnikov