Game Development Community

Checking vehicle speed

by Louis Dufresne · in Torque Game Engine · 10/04/2005 (5:33 pm) · 1 replies

This seems like such a dumb question, but for some reason I am unable to find this in script.
What is the variable that tells me the current speed of a wheeled vehicle?
I wanna be able to check my car's speed at certain intervals and do things based off different speeds.

This seems so easy and simple yet I am having trouble finding it. Anyone know? Thanks..

#1
10/08/2005 (11:28 am)
You will have to create your own function using these snipplets to update a gui control such as a text control:

This stuff is clientside btw.
%velocity = getControlObjectSpeed();

%cVel = mFloor(%vel * 2.491); // m/s * 0.691896 * 3600 / 1000 = 2.4908256 km/h
or
%cVel = mFloor(%vel * 1.5476); //2.27 * 3600) / 5280 = 1.5476 MPH