--this is a really simple script. i needed because of an animation where i always have to check the speed of the cars
-- select an object click "do it" button, and you can read the speed in [km/h] down in the listener.
-- your scene have to be in meter unit
-- you can easily modify to mph or m/s however you want :)
-- peace from Hungary
-- GiaNT

rollout speedometer "speedometer" width:104 height:45
(
	button btn1 "do it !" pos:[8,5] width:88 height:16
	label lbl3 "       by_GiaNT" pos:[7,25] width:88 height:16


	on btn1 pressed do
	(
	mycar = $
	carpos = mycar.pos
	
	t = slidertime
	slidertime = t+1
	
	carposnext = mycar.pos
	
	a = distance carpos carposnext
	slidertime = t
	
	v = (a*3.6*25) 
		
	print v
	)
)

spdfloater = newRolloutFloater "speedometer"  130  70
addRollout speedometer spdfloater
