I’m making a movement based game with a Wall Riding mechanic and I’ve been trying to get all the animations working correctly, I had all the movement set up properly, and then after making some changes my character movement became a lot slower for unknown reasons.
Here’s the method that Moves the Player, running off of a Fixed Update function to stayed synced with the Physics.
private void MovePlayer()
{
// Calculating Movement Direction, always walk in the direction you're looking
moveDirection = orientation.forward * verticalInput + orientation.right * horizontalInput;
// Adding Force to the Player Rigidbody if on Ground
if (grounded)
{
rb.AddForce(moveDirection.normalized * movementSpeed * 10f, ForceMode.Force);
} // If Airborne
else if (!grounded)
{
rb.AddForce(moveDirection.normalized * movementSpeed * 10f * airMultiplier, ForceMode.Force);
}
}
Setting the movementSpeed values runs off of a state machine where the movementSpeed variable is set equal to public variables for each of the different speeds of movement types (sprintSpeed, walkSpeed, wallRideSpeed) etc.
As far as I know nothing has changed on my RigidBody and Capsule Collider, I’ve only been working on Animations.