- Home /
Square Character Controller?
I am putting together a 2D game, and I was wondering if there is a way to 'square off' the character controller so that it doesn't slide off square platforms?
If not, am I best to make my own Character Controller script and apply some kind of rigid body to it?
Thanks!
What do you mean that the CharacterController slides off square platforms? Normally the CharacterController doesn't slide anywhere at all unless you make it do it. Can you elaborate a bit?
This isn't a z axis problem. If I position my character on a platform with a box collider and move the character controller right to the edge, it'll kind of 'slide' off, or occasionally just move down the edge slightly and stay there. What I want is a clean 'fall off'. It makes sense, because the CC has a rounded bottom (indicated by the oval shape of the collider?) but for this particular game I could do without it.
Rune,
Here is an example of the character sinking at the edge of a platform.
http://www.youtube.com/watch?v=gA8Ns_$$anonymous$$$$anonymous$$xv0
Bumping this, does anyone know of a workable solution for this problem with the Capsule collider on the character controller?
Answer by Jason_DB · Feb 25, 2010 at 12:59 AM
Do you mean from sliding off towards/ away from the screen (on the z-axis) or on the x-axis? If it's sliding of the z-axis you could just manually override the z position in the update of a script to keep it from changing, otherwise (if it's sliding along the x) the problem is likely the collider on the character or the platform rather than the script.
Answer by biomechanic · Mar 10, 2010 at 12:07 PM
CharacterController seems to be capsule only, you'd have to use a BoxCollider instead. If BC lacks any features of CC that you need - extend it with scripts.
Answer by ianismrt · Mar 01, 2012 at 09:30 PM
I know this thread is long dead but does anyone have any tips on how to combat this 2d platform problem? I'm getting the same results as in the video when my character nears the edge of a platform...
http://www.youtube.com/watch?v=gA8Ns_KMxv0 relink for laziness!
The rounded character controller bottom is resulting in some hideous platform climbing!
Answer by Pau678 · Jul 13, 2018 at 04:59 PM
yes but a collider dosn't have the option isGrounded fom the character controller
Your answer
![](https://koobas.hobune.stream/wayback/20220612083800im_/https://answers.unity.com/themes/thub/images/avi.jpg)