Did you put it in a function and called it at least for couple of frames? If you call it once, it may be not enough to move the target because of the friction. Try something like this:
put some int to store the time spent on thrusting inside actor class
Code: Select all
int ThrustState;
bool IsThrusting;
create some state in which the actor do the thrusting (

)
Code: Select all
States
{
GetOverHere:
TNT1 A 1 ThrustTarget(50, 10);
Loop;
}
the function, I did not look at the wiki, but your calculations seem to be alright
Code: Select all
ThrustTarget(int force, int duration)
{
if(!target)
SetState(SeeState);
if(!IsThrusting)
{
ThrustState = duration;
IsThrusting = true;
}
if(ThrustState > 0)
{
Vector3 thrust = Vec3To(target);
target.Vel -= thrust.Unit() * 255.0 * force / max(target.Mass, 1));
}
else if(ThrustState == 0)
{
IsThrusting = false
SetState(SeeState);
}
ThrustState--;
}