Question by
KAYBRAC · Jul 09, 2017 at 09:26 PM ·
car gamespeedometer
Hey I need to make a 3d speedometer for a car have a script for that works fine but rotate 360 degrees how i can amke it real
pragma strict
var velocidade = 30; static var origRotation : Quaternion;
function Start () { origRotation = transform.localRotation; }
function Update () {
if (Input.GetKey(KeyCode.W)){
transform.Rotate(Vector3.forward * velocidade * Time.deltaTime);
}
else if (Input.GetKey(KeyCode.S)){
transform.Rotate(-Vector3.forward * velocidade * Time.deltaTime);
}
else { transform.localRotation = Quaternion.Slerp(transform.localRotation, origRotation, Time.deltaTime); } }
Comment
Answer by KAYBRAC · Jul 18, 2017 at 04:08 PM
hey nobody know the answer ? maybe i have to do it otherwise ? but i dont need to use gui thats something esle.
Thank you for your help.
Your answer
Follow this Question
Related Questions
C# Min/Max Rotation based on Float? 1 Answer
[Scripting] Infinite road : handling rotations correctly 0 Answers
I can't import a sky-car,I cannot import the basic sky-car. 0 Answers
Speedometer is not accurate 1 Answer
unity 5 car tutorial 3D 1 Answer