how to made speedometer? any scripts? and instructions please help
I don’t know if this is what you where looking for but here is a script to get the velocity of an object and put it into a property called Speed.
controller = GameLogic.getCurrentController()
object = controller.owner
Xspeed, Yspeed, Zspeed = object.getLinearVelocity(True)
linSum = Xspeed + Yspeed + Zspeed
yValue = linSum
object[“Speed”] = Yspeed
but how to apply it for text for show on screen? the routing?
If you use 3d text then change the code where it says | object[“Speed”] | to | object[“Text”] | and that should make the text be the Yspeed.
The text should also have a always sensor that is linked to a python controller.
it not working
Ok sorry just realized I made a mistake.
I’ll upload a simple game I just made with the speed in text.
Copying Objects Speed.blend (565.0 KB)
Make sure that whatever you are getting the speed from is a Riged Body otherwise the code will not work.
if you want a gauge, you’ll need your float property normalized 0-1 and just multiply it times pi and use that as the radians for the orientation of a needle
hi bro thank you i check you file will try apply same way later to my game
for me this not work because text i was connect it to allways and to python but after was need connect to property the python
i will try do the same later it should work thank you
this is pretty simple to do
it uses the linervelocity to set a frame in an animation.
here is an example.
overlay2.blend (2.7 MB)
i did not see you wanted the speed as text, so here is a modified version
speed-overlay.blend (2.7 MB)
i will check this later i need rest form games thanks for try help
hi bro i try made as in you example but problem that circle speedometer dont show in my game scene
and if i add to camera add overlay scnene it show but speed not updated text not move and dont show the speed
maybe i do something wrong
did you download the blend above and test it ??.
yes belnd file work
but i try append overlay scene to my game from you blend file and connect speedometer and i cant understand how connect and made the same i did and connect all is in you example but it was not work
if you wish i can made video how i try connect it you will tell me what i forget or not did to it work
here video how try apply it it not work watch i know need do somethink i dont know
did you name things the same as in the script (it matters)
YES i name same
sorry for that i upload video now you can download and watch https://yadi.sk/i/DD7_HxWhKfT9og