Ship wont rotate as shown in video



I have followed the course with my own assets and my ship will not rotate as shown in the course. Instead it stays straight and moves statically around the screen. I also had a previous issue before I implemented Lerp where the ship turned sideways instead of straight. I tweaked my model in Unity a bit to fix that and not sure if that messed anything up.

I have included my blender project and my unity project.

Our camera is facing the XY plane, meaning that LookRotation needs to rotate around the Zed axis, which means that our reference should be Vector3.back. Vector3.left would rotate around the X axis, which would make it roll instead of turn.

    private void RotateToFaceVelocity()
    {
        if (rb.velocity == Vector3.zero) { return; }

        Quaternion targetRotation = Quaternion.LookRotation(rb.velocity, Vector3.back);

        transform.rotation = Quaternion.Lerp(
            transform.rotation, targetRotation, rotationSpeed * Time.deltaTime);
    }

That being said, you may also have to put your model under an empty GameObject to apply whatever rotations are necessary to make the ship’s default rotation match the rotation of the StarSparrow assets we’re using in the course.

Privacy & Terms