How can I let capsule character controllers step over small steps? #261
-
I use character controllers from the Demos code in my program, and I have some small steps (box with about 0.1 height, say) in scene. When I move the character controller to them, it just stucked by them. This feels a little bit unnormal. I have tried some parameters of the character controller structure, such as MinimumSpeculativeMargin, MinimumSupportDepth, MinimumSupportContinuationDepth but it seems the small obstacles stepping behavior are not affected by them. I also read some code in CharacterMotionConstraint.cs and CharacterControllers.cs but it's a little complex to me. So I want to ask, If there is a simple way to let the character controllers can step over small obstacles or stair steps, such as some parameters like "StepOverDepth"? Or I have misunderstand some parameters above, and passed wrong value for them? Any help will be greatly appreciated. Sorry for my English. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The demos character doesn't have a traditional step-up feature, it's just a capsule. When the capsule slides up to an obstacle, if the contact normal between the obstacle and the capsule is shallow enough to allow traction, the character can climb up. There's no actual difference between a step and a slope as far as the character is concerned. To "step over" larger objects, the demos character either needs a larger radius or a steeper allowed slope. (The bepuphysics1 character had explicit stepping that would teleport up step-like obstacles. I didn't reimplement that because 1. it was complicated as heck, 2. it was expensive, and 3. teleportation breaks all kinds of dynamics (imagine the character pulling a rope and teleporting). For a long while I've intended to implement another version that allows efficient stepping without teleporting, but the to-do list is long.) |
Beta Was this translation helpful? Give feedback.
The demos character doesn't have a traditional step-up feature, it's just a capsule. When the capsule slides up to an obstacle, if the contact normal between the obstacle and the capsule is shallow enough to allow traction, the character can climb up. There's no actual difference between a step and a slope as far as the character is concerned.
To "step over" larger objects, the demos character either needs a larger radius or a steeper allowed slope.
(The bepuphysics1 character had explicit stepping that would teleport up step-like obstacles. I didn't reimplement that because 1. it was complicated as heck, 2. it was expensive, and 3. teleportation breaks all kinds of dynamics (imagine the …