speedometer
Hi guys. So I have this simple car script. I added speedometer in side cockpit. I created needle from polygon. I would like to make this needle go to the right when I press right key arrow on keyboard and to stop at 180 degree. When I leave button I want needle to got left to a 0 degree. When I press down key arrow needle need to behave like am speeding. How do I do it? car script am using:
var speed : float = 10.0; var rotationSpeed : float = 100.0; function Update () { var translation : float = Input.GetAxis ("Vertical") speed; var rotation : float = Input.GetAxis ("Horizontal") rotationSpeed; translation = Time.deltaTime; rotation = Time.deltaTime; transform.Translate (0, 0, translation); transform.Rotate (0, rotation, 0); }
Your answer
Follow this Question
Related Questions
Vehicle going through objects 1 Answer
Sync car audio on UNET network game 0 Answers
Wheel Rotation Is all messed up 0 Answers
Rotate Camera with player vehicle 0 Answers
Unity 5 Standard Asset Car Waypoint AI problem with accuracy 0 Answers