Essentially what the title says.
CC is being controlled by .Move(); with slope limit at 45.
But it doesn’t matter what settings I use. If I run against a wall that is not perpendicular, the character just climbs up that wall. It looks especially ridiculous if that’s a tree:). If the wall has an exact 90-degree angle, then the CC behaves normally. If I were to make Minecraft, that would be fine. But I am not.
Reproducible in an empty scene on:
2019.4.xx, 2021.1.xx
Literary every post I saw on the web with the same issue, didn’t have any replies whatsoever:rage:
I question your reproduction steps. I am able to reproduce PERFECT functionality: the CC climbs a 44-degree slop, stops at a 46-degree slope. Just tested on: Unity2019.4.15f1 and Unity2021.1.0f1
See attached package exported from Unity2019.4.15f1
Thank you for the reply.
I tried to use a cube (within unity) as a slope, and the character component really worked with it as you’ve described!
I then started to dig a bit deeper into why this happens, and it turns out, that if you use a box collider, then the CC works as intended, but if you use a capsule collider, then it doesn’t.
To reproduce: Add an empty GO with capsule collider so that it is perpendicular to ground, rotate 10 degrees on the x-axis. Even if the slope limit is 35 or whatever, the CC will climb up that collider.
For me rotating the object did not change the slope climb behavior.
But one thing I noticed is that if you even give it a TINY smidge of up vector (even as little as new Vector3( 3.0f, 0.001f); ), then it will happily climb slopes beyond its limit.
Therefore it seems important that your Y movement component remain zero.
I don’t have it in front of me but I don’t think I’m using ANY collider, just letting the CharCon do its thing… but if I forgot and left it in place, then it would indeed be a capsule collider. Possibly if you add a collider you are getting a “lever-up” effect going on?
Having this problem too. Character Controller works properly when colliding with square level geometry, but my player keeps climbing on top of enemies with capsule colliders, even though they are taller than my character controller step limit.
Both character and enemies have a capsule radius of 0.3, step limit is 0.25, slope limit 45°, and enemy collider is 0.75 high. Seems like maybe the height of the capsule mid-section (0.75 - 2*0.3 = 1.5) is being tested against step height and the height of the bottom curve is being ignored? It wasn’t doing this when my enemies had a taller collider (I tweaked it to better match the shape of the enemy creature).
Edit: I was able to improve the situation by adding a box collider to the lower part of my enemy creature. It needed to be 0.5 tall to stop the player riding up and over, which still seems odd given that I can’t climb a step that’s even 0.01 units higher than my step offset. Anyway, this setup still allowed me to keep a rounded top for my enemy collider, and the bottom shape doesn’t matter as much. (The enemy uses navmesh agent to move, so the collider shape doesn’t enter into locomotion, just physics interactions.)
I had this problem and found out it was because I was using transform.translate instead of moving the enemy with the rigidbody. If you move the enemy with the transform it will take the position and your character will move up
This problem could be due to how CCT is being moved.
Assuming a simple setup of an object with only CharacterController attached (no rigid bodies, no other colliders), if using Move you need to always take care of gravity yourself! Even if only moving in XZ plane, your CCT may not be grounded from the start (the exact y-position that isGrounded reports true is not easy to determine visually). If the controller is not grounded at all, he may climb all sorts of colliders way above his slope limit/step offset.
If you want a simpler alternative, you may use SimpleMove that takes care of gravity itself.