I know what you’re thinking,
“Use a slope collider over the stair model and its easy to move up!!!1!”
No.
This is stupid, and is merely a temporary solution to a much bigger problem.
Because this problem doesn’t just affect stairs, but any surface you attempt to step up onto.
You just can’t put invisible slopes everywhere in your game.
So why in the Unity CharacterController, after 4 versions of Unity, is this still a problem?
No matter the step offset, you will still get hung up on a step if you are not moving fast enough.
This is not a problem in any other game I’ve seen, so why is it such a problem here?
What are those games and game engines doing, that Unity’s character setup is missing?
Does the new physics based character controller fix this?
How does one even fix a problem like this without having invisible slopes or microscopic steps?
Any input would be greatly appreciated.
Thanks
1 Like
What do you want to happen? Should the CharacterController just shift up when it hits a stair?
The CharacterController is very simple and it has trouble doing much more than moving over terrain and bumping into walls. All those other games implement their own “CharacterController” with a lot more custom code to handle situations like stairs.
Otherwise, I would suggest doing some Raycasts or something to determine if the wall you are bumping into is a stair step, then manually move the CharacterController up so it can move over the top of the step.
I was kind of hoping I was just missing something, and it was kind of like one big inside joke I had yet to be included in…
Oh well
Question about the raycasting, wouldn’t I have to raycast in all directions around the capsule-shaped collider to make sure the player could step up no matter which way he was facing?
Or would a SphereCast do just fine if I measured the distance between the player’s feet and the point in space the step was hit?
lol if I am just missing something and someone clues us in, I’d be happy!
I normally do raycasts in the direction the player is moving to see if there’s a step, then a capsulecast to see if the player fits. I have a helper class that can take CapsuleColliders and CharacterControllers, perform a bunch of raycasts, then tell me what the player is touching, or what is around the player.
This is what I’ve done. I’d love to see how other people deal with stairs.