open-project-1 icon indicating copy to clipboard operation
open-project-1 copied to clipboard

Fixed character movement stuck bug

Open kablouser opened this issue 4 years ago • 1 comments

https://github.com/UnityTechnologies/open-project-1/issues/499

Solution: If OnControllerColliderHit occurs multiple times per frame (i.e. the CharacterController has multiple hits) then pick the hit with the highest normal.y value (i.e. pick the hits near the bottom of the capsule).

Explanation: Inside IsSlidingCondition.Statement(), the checks for step height and slope limit assumes there is only 1 hit per frame. However, if the player is standing on a flat surface and is touching a vertical wall. And, if the vertical wall's hit is last to be messaged. Then, the player could either slide directly upwards (which would unstuck the player) or downwards (which would cause the issue).

Verify: Reproduce the steps described in the issue.

kablouser avatar Sep 25 '21 16:09 kablouser

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Sep 25 '21 16:09 CLAassistant