Game Development Community

MOving an object based upon its rotation

by \"Robert Jaramillo\" · in Torque Game Builder · 02/19/2010 (3:40 am) · 3 replies

Hello, you guys

I have an object that is rotating around my player right now which is what I wanted. However when I fire this object I simply set his Y velocity so it can begin to move but I don't think that it is right? anyways I would take any suggestions you folks have for out in a straight line based upon its current angle.

#1
02/19/2010 (4:40 am)
You probably want the functions "setForwardMovementOnly" and "setForwardSpeed". This uses the object's current angle to determine movement.

You can get more information at TDN: tdn.garagegames.com/wiki/TGB/Reference:_t2dSceneObject_Physics_Methods#setForwar...
#2
02/19/2010 (10:26 am)
Hello, I have tried what you suggested and I get an invalid parse error for some reason. If my object is a t2dsceneObject what would the reason be for this. Posted below is the function as I am using it

function Harpoon::Fire(%this)
{
%this.bIsReadyToFire = false;
%this.setForwardMovementOnly(true);


%this.setForwardSpeed(6);
}
#3
02/19/2010 (10:29 am)
Hello, I have tried what you suggested and I get an invalid parse error for some reason. If my object is a t2dsceneObject what would the reason be for this. Posted below is the function as I am using it

function Harpoon::Fire(%this)
{
%this.bIsReadyToFire = false;
%this.setForwardMovementOnly(true);


%this.setForwardSpeed(20);
}

Also