I am making a 3D Platforming game and have been using the Unity Character Controller to assist me with my characters movement but have run into a problem.
The problem is this:
Because of the shape of the collider you can hang on the edge of a platform by either jumping up onto something you cannot quite reach or by just slightly walking off.
I have looked up changing the shape of the collider but seems this is not possible.
I’ve been going down the route of changing my movement controller to use a rigid body instead but have realized how much I rely on the character controller. Is there a way to fix this without having to go down that route?
The character controller component is effectively a wrapper for the character controller in the PhysX engine that Unity uses, which I believe is only ever a capsule.
It should still be able to slide off edges. You probably just need to check a small area below the player (small spherecast perhaps), and if nothing is found, add a downwards force to the vector you supply to the controller component.
Mind you, there should always be a downwards direction supplied to the component whenever the player isn’t moving upwards, even if they’re just resting on flat ground.
Hey thanks for the reply. My idle state was the only state that didn’t apply any downward movement because I don’t need to check is grounded in that state, but sadly adding downward movement to the state hasn’t made the character slide off the edge, seems it is still stuck.