Hello, I have a simple first person controller with the basic script of the Modular First Person Controller and I’ve noticed, that during some combination of keys player suddenly freezes.
Can you tell me how to protect the player from jamming? Is it possible to change the script to:
if W, S or space keys are pressed but there is no movement and there are no obstacles in front of and on the sides of the player, but the player can not move, then return Rigidbody to the default state
?
something like:
if (targetVelocity.x != 0 || targetVelocity.z != 0 && isGrounded)
{
isWalking = false;
}
else
{
isWalking = false;
}
if (Input.GetKey(KeyCode.W) && (Input.GetKey(KeyCode.A) && (Input.GetKey(KeyCode.D) && (Input.GetKey(KeyCode.S))
{
transform.position = originalPos;
}