Vehicle Speed
by Xavier "eXoDuS" Amado · in Torque Game Engine · 10/06/2002 (11:15 am) · 6 replies
How would you get the vehicle's speed in the engine code for use on a gui control?
getVelocity returns a 3 dimensional point... what's this?
Thanks.
getVelocity returns a 3 dimensional point... what's this?
Thanks.
About the author
#2
getControlObjectSpeed()
which should give you what you're looking for...
10/06/2002 (11:42 am)
There is also a global script functiongetControlObjectSpeed()
which should give you what you're looking for...
#3
10/06/2002 (12:51 pm)
Thanks a lot guys
#4
10/06/2002 (1:39 pm)
Mmmm.... this speed.... what speed is it? because it seems to include the 3 vectors... if you fall or climb it affects the speed too... how would i limit this to the linear speed?
#5
%linspeed = GetWord(%vel, 0) @ " " @ GetWord(%vel, 1) @ " 0";
%speed = VectorLen(%linspeed);
10/06/2002 (3:55 pm)
Just zero out the Z component, something like this:%linspeed = GetWord(%vel, 0) @ " " @ GetWord(%vel, 1) @ " 0";
%speed = VectorLen(%linspeed);
#6
vel.z = 0;
voila! heh :)
Thanks guys
10/07/2002 (2:33 pm)
Thank you, but since I was doing this from the engine code it was even simpler :)vel.z = 0;
voila! heh :)
Thanks guys
Torque Owner Mike Stoddart