I have a nice dive effect to which I want to add a pitch value to the sound; my problem is that the pitch is rather sudden - I need a larger fade value when I pitch; here’s my code:
if( distanceToGround > 20 && euler.x > 18 )
{
diveEffect.active = true;
audio.pitch = Mathf.Lerp( 0, 3, 2.5);
}
if( distanceToGround < 1000 && euler.x < 10 )
{
diveEffect.active = false;
audio.pitch = Mathf.Lerp( 0, 0.5, 2.5);
I also tried Matf.Clamp but that didn’t work either.