Game Development Community

Yet another "Whats Wrong With My Code" question

by Jumex · in Torque Game Builder · 08/27/2007 (6:24 am) · 1 replies

Function jump()
{
$stop = $dude.getPositionY();

If ($stop > 10)
{
$dude.setLinearVelocityX(-50);
}
}




The starting position of $dude is (X= -41.317) and (Y= 8.370) This is the only jump code I have so starting the game the guy should not be able to jump and yet he manages to do so anyways.

#1
08/27/2007 (6:53 am)
Hmm looks fine to me... try puting and echo satatement (echo($stop);) just before the if statment and see what it says. This will just confirm for us that $stop is actually 8.370.