Game Development Community

T2dPath Node Reset?

by Jim Taylor · in Torque Game Builder · 09/20/2008 (9:16 pm) · 3 replies

I have a very basic project that simply consists of a t2dPath with a static sprite mounted to it and obviously following the path.

What I am trying to do is use a keypress to modify the speed at which the sprite tracks around the path using the setSpeed method but whenever the key is pressed the sprite is reset back to Node 0 of the path.

The speed does change but why would a call to change the speed reset the path to start at the first node again?

Hopefully I am missing something simple but I have searched the documentation and couldn't find anything. Any help with this would be greatly appreciated!

Thanks

#1
05/27/2009 (10:50 pm)
Jim,

Have you solved this issue?

If seems we are not the only ones to run into this problem. I just can't seem to find a solution.

Thanks,
Randy
#2
09/21/2009 (8:18 pm)
The only way I could fix this problem for myself was by modifying the source - without that, the object's position is reset every time the path speed is changed.

In t2dPath.h, change

if (pathedObject) pathedObject->setSpeed(speed, true);

to

if (pathedObject) pathedObject->setSpeed(speed, false);
#3
11/18/2009 (5:07 pm)
Documentation's incomplete. See here:

www.garagegames.com/community/forums/viewthread/106027