Objects 'Climbing' Other Objects Unintentionally

Ok, so… here’s the simple little scene setup:

  1. A chunk of terrain
  2. A Cube sitting on the terrain
  3. A CharacterController also on the terrain

Now, the character controller has the ability to move around on the terrain, falls to it with gravity, and takes input from the WASD keys to move the character along the X and Z axes (i.e. along the terrain)… a typical setup. As for the box, it has a rigidbody and a box collider attached. The camera is at a fixed angle looking down towards the terrain, and is positioned up and out from the player (+Y, -Z axes), does not rotate, and follows the player’s movement.

The issue I’m seeing is when the character walks around the backside of the cube, and walks towards it, he will, nearly every time, ‘climb’ up the backside of the cube. However, this doesn’t seem to happen with any other sides of the cube.

Has anyone else experienced something similar? It doesn’t seem to be affected by any scripts I have attached, which makes me think something is happening with the physics components, but you never know…

Try changing the slope limit of the character controller to something lower. I believe it defaults to 90 degrees, which basically means it should be able to walk up walls. try something like 45 which should allow the controller to walk up hills, but not vertical walls.

It’s actually set to 45 at the moment. It only seems to do this with the backside of the cube (and by backside I mean, the side facing away from the camera), but not the sides or front. :?

I couldn’t get the slope limit to work no matter what I tried. It always climbs up slopes even at like 88 degree angles. I hate how it has to be capsule shaped, because even setting the step limit to like 0.01 or 0.001 it still slides up and down anything under like 0.5 units taller than the ground it’s on. It also roundly slides down platform corners making it clear that it is rounded at the bottom, which is terrible for platformers. I’ve also had to create all kinds of workarounds to keep the corners from getting stuck on platform corners in certain situations. Meh.

Hi guys!

I’m newbie using Unity3d and I have the same problem than dwsarber.
My scene is more complex than a terrain with a cube, but with some objects in the scene I have that problem. I have tried to change the slope limit and it doesn’t work, I also have tried changing the skin width but if I put a skin width too high to solve the problem then the character “flies” on the scene, so I don’t like this solution.

Anybody has solved this problem or has an idea to solve it?

Thank you!

Don’t use the character controller if it does not work for your purpose. Its just a combination of other components and you can replicate all it does including modified versions that work for your case.

I’m using a cube as a character, with a rigidbody, and a simple controller:
e.g.
character.transform.Translate (Vector3.left * Time.deltaTime * 4f);

Because the default charactercontroller made my cube bounce/vibrate against any surface when walking.
Right now it stays still when you walk-jump into a wall, and when you press jump while holding the key in the direction of the wall surface, you go higher, and with a little practice you can “climb” over any wall.