Game Development Community

How to get the speed of my control object?

by Yin Yi Jia · in Technical Issues · 08/09/2005 (4:17 am) · 2 replies

Actually, I am doing a racing game, I am just wondering if I could get the speed of the control car, I have tried getcontrolobjectspeed method, but it does not work.

Could anyone do me a favour? thanks a lot!

#1
08/09/2005 (5:09 am)
Hmm, well one way would be to go...

%client.getcontroledobject().Getvelocity();

if you want a single number, then just calulate that into a distance from one.

Note, i may have the function spelling wrong...since its 5am
#2
08/09/2005 (5:39 am)
Yes, it works.

$myplayer = %client.GetControlObject(%player);

echo($myplayer.getVelocity());

and it returns three number like 3.62308 -5.79551 -2.81921 what are these three numbers supposed to mean ?


now I guess the three numbers represent the speed in the x, y z axis respectively, am I right?