Why can't the Physics Locomotion System walk up stairs/inclines?

I am having a lot of trouble getting the Planet Scene, Physics/rigidbody Locomotion System character (Hero), to climb a primitive set of stairs. The problem seems to be the capsule collider getting caught on each step and the permanent gravity force pushing down. I am using a clean, new copy of the Planet scene from the Locomotion Demo, and for the stairs I have simply arranged several cubes together.

The character will struggle to climb the first two steps, and after that will not go any higher unless jumping. I am after getting behaviour like in the Crate Climb demo, but with a rigidbody driven character (not character controller), is this possible?

The things I have tried:

  • Adjusting the Max Step height, Max slope angle and the Tilt Amounts
  • Raising the bottom of the capsule collider
  • Copying the Leg Animator settings from the Crate Climb scene
  • Turning off Centric Gravity
  • Testing with a ramp
  • Writing a new rigidbody motor (uses a raycast to tell if grounded)
  • Writing a second rigidbody motor (uses OnCollisionEnter to tell if grounded)

If I use the same Stairs prefab in the Crate Climb scene the character has no problems getting to the top. Surely you’re not restricted to just the CC for climbing elevated surfaces. Has anybody else experienced similar troubles with the Physics Locomotion System like this? Please let me know how to resolve this, as I plan to use the same setup for my own character.


Planet Scene - Using Capsule Collider:

alt text

Crate Climbing Scene - Using Character Controller:

alt text

Ramp Test - Same incline as stairs

alt text

SOLVED - See the inspector for the settings

alt text

2 Answers

2

Seriously, I would rewrite/make your own motor. I remember testing the Locomotion System’s physics motor back in the day and it was quite a terrible system for anything other than using centric gravity. Very impractical for any movement over non-flat surfaces, which seems kinda ironic actually. If you don’t wanna write a motor script from scratch try changing the way gravity is handled. For example, only apply gravity when the character is not grounded. Also, try making the capsule radius wider which will make the bottom rounder and less likely to get caught on your steps.

The main problem you’re having is that the forward force (when walking, running etc) is competing with the gravity force whenever there is any sort of incline. Meaning if the force driving your character forward is less than the gravity force pulling it down, it can never generate enough speed to climb the surface. You could see this when you turned off gravity and it had no problems climbing. Another test you could do is set gravity to 0.1, walk up your steps and when you get stuck try holding shift to start running, it should start climbing. This is because the added boost from the run is enough to over power the weaker gravity force. Anyway, see how you go.

Don't know about 'broken', but there defs isn't much info about setting up a rigidbody based locomotion system. Like I said, I didn't find it particularly useful for uneven surfaces and ended up making my own system from scratch. You probably don't want to hear this, but there could be a better way for doing the motor script you tried above. Try giving these two a try first and if you still have problems let me know: http://www.unifycommunity.com/wiki/index.php?title=PhysicsFPSWalker http://www.unifycommunity.com/wiki/index.php?title=RigidbodyFPSWalker

Glad you figured it out! A rigidbody setup is a bit harder than a CC setup intially imo, but once everything falls in place it is much more flexible and easier to do awesome things with. Good luck with the rest of it.

Try reducing the radius of the capsule collider and increasing the depth of each stair step (make each step farther from each other). It seems that the capsule is touching the current stair step AND the next one, in the same time, causing it to think you are on a really steep cliff.