Player Movement Rotation
The PlayerMovementRotation
class is responsible for managing the rotation of a player character during movement.
Properties
private PlayerRotation playerRotation
: References thePlayerRotation
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 thePlayerMovementRotation
class, assigning thePlayerRotation
Methods
public void Rotate()
: Handles the rotation of the player character during movement. It checks if thetargetRotation
has changed, and if so, smoothly transitions the player's orientation towards the newtargetRotation
.
Last updated