Game Development Community

GetPositionX/Y don't work?

by StickFigs · in Torque Game Builder · 08/10/2007 (6:59 pm) · 2 replies

I'm trying to use this code to set an object's position:

$posX = $pGuy.getPositionX;
$posY = $pGuy.getPositionY;
$pGuy.setPosition($posX,$posY);

But it keeps telling me I don't have enough parameters for the setPosition and if I echo the $posX and $posY it shows up as blank.

It seems like getPositionX and Y aren't working properly for some reason. Am I using them wrong?

#1
08/10/2007 (8:58 pm)
Maybe try something like this

$posX = $pGuy.getPositionX();

Aun.
#2
11/11/2007 (5:14 pm)
Aun is right. To expand a litte for the newbs...

Whenever you see code like getXXX it is typically a function. Functions require you to add parentheses at the end. So you'll end up with code like getXXX().