Why is my Jump Height affected by Walls?

My game’s main character is using a rigidbody:

  • The player’s physics material has zero friction because otherwise, jumping and steering against a wall would make the player stick to the wall.
  • Jumping is done by applying a large impulse to the character via rigidbody.AddForce(..., ForceMode.Impulse).

Now when the player is very close to a wall (or steering into it), he can jump almost 50% higher:

9129-jump-height-illustration.png

Can someone explain this effect or offer a workaround?

It took some searching, but I dug out another question here on UnityAnswers that provides a workaround:

Rigidbody Character Jumps Higher With At Least 2 Collisions

If I add a rigidbody to the wall (not just a collider) and enable its Is Kinematic property, the jump height next to that specific wall remains constant, avoiding the issue.

There is still a big WTF hovering over my head, but I remember having read somewhere in the Unity documentation that any object that interacts with physics should have a rigidbody, so I guess this is a “by design” issue.

The Walls collider are tall thus when u jump(While hugging the wall) the Collider on the player still remains in contact thus Forces adds up making the jump more higher.

WORKAROUND

Simply make bool variable and make it true when in air and false on landing. and call the jump only when variable is false.
,Anyone facing this issue can just add bool variable which is true,when GameObject is in the air and false,when it lands.