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
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
About the author
#2
In t2dPath.h, change
to
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
www.garagegames.com/community/forums/viewthread/106027
11/18/2009 (5:07 pm)
Documentation's incomplete. See here:www.garagegames.com/community/forums/viewthread/106027
Torque Owner Randy Lutcavich
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