- Home /
Preventing CharacterController sliding down edges on platforms, ground detection.
Hey guys!
Sorry if this has been answered before, but I've been looking for some solution to this for weeks, and I still haven't been able to figure it out.
So here is my problem:
I'm using a CharacterController for my player's movement, and it works wonderfully for every type of terrain or slopes I want in my game, except for the edges of platforms. Because it uses a capsule collider, it "sinks" down the edge until it's no longer touching the platform before falling down like in the first picture.
I'm working with -y value for gravity and the character is able to jump when grounded (The ground check I use now is controller.isGrounded)
What I want is for the CharacterController to behave like the second picture, but ONLY on the platform edges, as it works perfectly in all other cases as of now.
I've tried a bunch of different solutions with Raycasting/BoxCasting for the GroundCheck, but I haven't been able to make it work like I want. I'm still pretty new to coding, so this has me stumped.
Any suggestions?
EDIT: To clarify: I'm not using the built in physics.
Answer by mike29willems · Mar 16, 2019 at 03:35 PM
Are u using physical materials and do u use PhysicMaterialCombine.Maximum
when jumping?
Answer by MlleBun · Sep 15, 2019 at 10:36 AM
Maybe this might help ? https://www.reddit.com/r/gamedev/comments/bmvpey/make_an_object_fall_when_it_is_near_an_edge_using/
Your answer
Follow this Question
Related Questions
charController.move() much slower with exact same values? 0 Answers
I need HELP ! Wall Jump in 3D Platformer CharacterController 0 Answers
Character controller stopping. 0 Answers
knockback 3d c# 1 Answer