- Home /
CharacterController gets stuck on stairs.
Hi,
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.
Answer by Edy · Sep 28, 2014 at 11:33 AM
Set CharacterController.slopeLimit to 90
Edit CharacterMotor.js and void the function AdjustGroundVelocityToNormal around the line 364:
desiredVelocity = desiredVelocity; // AdjustGroundVelocityToNormal(desiredVelocity, groundNormal);
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.
Answer by Briksins · Jul 21, 2013 at 02:42 PM
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
I'm going through the book and it uses different enviornments and objects etc. That's besides the point, in that video it shows later that you don't want to have it at 90 because then you can climb steep cliffs and they adjust it back down to 60. $$anonymous$$y issue is that that I cannot get a balance between slope limit and step offset that will fix it. $$anonymous$$oreso changing the step offset doesn't affect the issue I mentioned. If you apporach slow enough it'll stop you.
Your answer
Follow this Question
Related Questions
Player stalls on consecutive steps 0 Answers
Character stuck climbing 0 Answers
Forcing a Character Controller to slide down? 5 Answers
Starter Asset Capsule gets stuck on corners 0 Answers
Character controller won't climb steps if pushing at a wall 0 Answers