The rocket rotates on the wrong axis when colliding with the sphere

Hi Daz,

Welcome to our community! :slight_smile:

I don’t know in which lecture you are but do you have this piece of code in your Rocket class?

    void ApplyRotation(float rotationThisFrame)
    {
        rb.freezeRotation = true;  // freezing rotation so we can manually rotate
        transform.Rotate(Vector3.forward * rotationThisFrame * Time.deltaTime);
        rb.freezeRotation = false;  // unfreezing rotation so the physics system can take over
    }

If so, test this:

    void ApplyRotation(float rotationThisFrame)
    {
        rb.angularVelocity = Vector3.zero; // set the angular velocity to (0f, 0f, 0f)
        transform.Rotate(Vector3.forward * rotationThisFrame * Time.deltaTime);
    }

Did this fix it?


See also: