Refactor video. Cant get audio to play properly on all thrusters

Hi all. Im a Unity Noob. I can’t get the thruster audio to play on all 3 thrusters properly. I read of some fixes but I just can’t figure it out. I think the ProcessThrust is always running the audiosrc.Stop() first on every frame and my left and right thruster sound is infinitely starting and stopping and it sounds broken. Anyone have a fix? Thanks!

Fixed it! I just removed the processRotate from Update and wrapped it all up in the ProcessThrust method like this

void ProcessThrust()

{

    if (Input.GetKey(KeyCode.Space))

    {

        StartThrusting();

    }

    else if (Input.GetKey(KeyCode.A))

    {

        RotateRight();             

    }

    else if (Input.GetKey(KeyCode.D))

    {

        RotateLeft();            

    }

    else

    {
        StopThrusting(); 
        StopRotate();       

    }

}

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms