Game Development Community

Path Object setSpeed

by Michael Hart · in Torque Game Builder · 03/31/2011 (6:46 am) · 6 replies

Hi,
Sort of new, I'm using the setSpeed method on a path object, it works but it when this is called the attached object has its position reset. I tried to call setPosition to force it to move back to its last position, but that won't work.

Suggestions? :)

About the author

Recent Threads


#1
03/31/2011 (7:02 am)
Please post your code.
#2
04/03/2011 (5:11 am)
There isn't much code, I'm just testing this via console.
Given an entity anEntity has behaviour EntityBehaviour:
function EntityBehavior::onAddToScene(%this, %scenegraph)
{
    %this.owner.enableUpdateCallback();
}

Given anEntity is travelling on a path, I do this via console:
$anEntity.getAttachedToPath().setSpeed($anEntity,10);
Upon calling this line, the entity resets to its original position.
#3
04/03/2011 (8:20 pm)
@Michael - This is interesting. I think that may be the intended behavior, even if it is not ideal. I will see if I can find some code that might fit what you need, but I have not worked with path objects in a long time. Might take a day or two. If you have not resolved this or heard back from me in a couple of days, just bump this thread to remind me.
#4
04/07/2011 (3:28 am)
The bump you requested :) I don't really see a way around this..
#5
04/13/2011 (4:50 am)
Still looking at this.
#6
05/01/2011 (4:05 am)
Overdue bump, Michael did you resolve this?