CharacterController gets stuck on stairs.


I’m following the book “Unity 3x Game Development Essentials” and I noticed something that I cannot for the life of me fix. There is an outpost object that you import in one of the chapters. If you go up approach the stairs with speed you go up them as you would expect but if you approach them very slowly you get stuck on them as if you were trying to climb a steep slope. As far as I can tell from the mesh collider on the outpost theres nothing weird around the steps either. The only way I was able to get it to not get stuck on the stairs was to change the slope limit to 80 or 90 which isn’t really a good fix. Changing the step offset doesn’t do anything to help the issue either. Since I’m in the process of learning I figured it would be good to know what’s causing this issue and how to fix it rather then trying to make some work arounds. If someone could figure out what the issue is and how to fix it I would really appreciate it! Thanks! I posted a SkyDrive link to my project files.

  1. Set CharacterController.slopeLimit to 90

  2. Edit CharacterMotor.js and void the function AdjustGroundVelocityToNormal around the line 364:

    desiredVelocity = desiredVelocity; // AdjustGroundVelocityToNormal(desiredVelocity, groundNormal);

  3. Use the curve CharacterMotor.slopeSpeedMultiplier for fine tuning the velocity of the character on each slope angle.

Note that CharacterController.stepOffset has a different effect now. If it’s set to 0 you will still be able to climb steps as long as they collide naturally with the character’s collider. The climbing speed will be defined by the slopeSpeedMultiplier curve. You might consider stepOffset now as a kind of “step climb helper” that allows faster step climbing.

In the video tutorial of “Unity 3x Game Development Essentials” it was specifically recommended to increase slope limit to 90, you can see that video chapter on my DropBox