0
\$\begingroup\$

Here's a really short video (less than 30s) of this issue : https://www.youtube.com/watch?v=JrKbpTY8cMU

When I move the player towards a slope (the player is below it), it pushes the player inside the floor Collider instead of blocking it.

I've searched the Internet for a while but haven't found anything about it

Do you have something in mind ?
Thanks for your time

Info : I move the player using rigidbody.MovePosition()

The collision of the player is a Capsule.

\$\endgroup\$
1
\$\begingroup\$

for these types of controlling objects you shouldnt use RigidBody that has non-Deterministic Behaviour. instead you have to use character controller. its simply works with Colliders and doesnt let character move byond them but has no physics in it. then you can use:

  characterController.Move(moveDirection * Time.deltaTime);

https://docs.unity3d.com/ScriptReference/CharacterController.Move.html

\$\endgroup\$
  • 1
    \$\begingroup\$ I followed your suggestion and modified all my code to work with the Character Controller and it works like a charm. Thanks a lot ! \$\endgroup\$ – Sharpnel Sep 24 at 9:52
  • \$\begingroup\$ @Sharpnel great \$\endgroup\$ – virtouso Sep 24 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.