Player Movement Rotation

The PlayerMovementRotation class is responsible for managing the rotation of a player character during movement.

Properties

  • private PlayerRotation playerRotation: References the PlayerRotation associated withPlayerMovementRotation.

  • public Quaternion targetRotation: Represents the desired rotation of the player character during movement.

  • public Quaternion smoothTargetRotation: Represents the smoothed rotation.

  • public Quaternion oldTargetRotation: Represents the previous target rotation.

  • private float rotationSpeed: Represents the rotation speed.

Constructor

  • public PlayerMovementRotation(PlayerRotation playerRotation): Initializes a new instance of the PlayerMovementRotation class, assigning the PlayerRotation

Methods

  • public void Rotate(): Handles the rotation of the player character during movement. It checks if the targetRotation has changed, and if so, smoothly transitions the player's orientation towards the new targetRotation.

Last updated