Game Development Community

GetDirection ?

by Joshua "RegularX" Birk · in Torque Game Builder · 08/11/2005 (4:21 pm) · 4 replies

This might be right in front of my eyes, but I've having trouble phrasing it right to search, etc.

Is there a function to get an object's moving direction? Not the rotation, or even their velocity, but rather the compass number for which they are actually travelling towards? Does that make sense?

#1
08/11/2005 (4:55 pm)
%this.getLinearVelocityPolar();

This command returns first the Angle %this is traveling and the Speed at which it is moving.
#2
08/13/2005 (5:14 pm)
Might not be relevant, but I thought this only works when you also set your objects speed using a polar velocity (and not with an XY speed).
#3
08/16/2005 (10:48 am)
To clarify; the polar functions just set/get using polar notation but still end up changing the X/Y velocity and obviously work the other-way around.

- Melv.
#4
08/16/2005 (4:18 pm)
Thanks! I'm trying to let the physics engine handle it for me now, but if that fails, this will help.