Game Development Community

GetVelocity of mounted object?

by Teck Lee Tan · in Torque Game Builder · 09/09/2006 (5:18 am) · 2 replies

I came across an oddity, but I'm not sure if this is expected behaviour, or a bug. Right now if I try to getVelocity() of a mounted object, it always returns 0, whether or not the object is moving. Doing the same on the parent object works just fine.

If this is expected behaviour, is there any way to get the velocity of the mounted object?

#1
09/09/2006 (9:28 am)
It's expected behaviour. :)

Mounted objects don't tracking their parents by integrating velocity, they are repositioned each simulation update therefore they don't have any velocity. That's why, when you dismount and object, it doesn't continue to move.

- Melv.
#2
09/09/2006 (1:01 pm)
Ah, gotcha. Thanks for the clarification. I'll probably just go with my old code, then, that involved moving the mounted object (player) to the dummy object. :)