Engine sound is not working perfectly.
I'm working on a car game ;Where I'm getting the pitch value from my topspeed and current speed,but sound is very buggy.Any solution ?
public float Topspeed=100;
void Update()
{
AnalyzeSound ();
}
public void carMovement()
{
currentSpeed = wc [2].radius * wc [2].rpm * 60 / 1000 * Mathf.PI;
currentSpeed = Mathf.Round (currentSpeed);
}
AnalyzeSound ()
{
audio.pitch = currentSpeed / Topspeed;
}
Comment