Rotate only when thrusting

So I added more of a challenge to my game. The player has to thrust to be able to turn. It seems more realistic this way. First I created a bool called isThrusting inside the movement class, above Start(). Here are my modifications.

void Update()
    {
        ProcessThrust();

        if (isThrusting)
        {
            ProcessRotation();
        }
        
    }
void ProcessThrust()
    {
        if (Input.GetKey(KeyCode.Space))
        {
            rb.AddRelativeForce(Vector3.up * mainThrust * Time.deltaTime); //adds forward thrust to the rocket
            isThrusting = true;
            if (!m_MyAudioSource.isPlaying)
            {
                m_MyAudioSource.PlayOneShot(mainEngine);
            }
        }
        else
        {
            m_MyAudioSource.Stop();
            isThrusting = false;
        }
    }

Privacy & Terms