Character Controlling grinding along any non-flat Terrain

Hey all,

Working on a 3rd person controller that is using Unity’s built-in Character Controller.

As a test area, I simply made a small terrain, and made random bumps, plateaus, etc, in order to test out the controls.

However, on anything that isn’t the default 0 height flat terrain, even completely flat plateaus, my character almost constantly slowly grinds along the ground, happening more so when I’m going left or right.

I’m using the built-in Character Controller functionality, so forward movement is as simple as

controller.Move(transform.forward * speed * Time.deltaTime);

Anyone had this issue before? No problems falling through the world, but this grinding will prevent any use of this in game.

I should also mention the height is 1, radius is 0.5, slope limit is 45, step offset is 0.3, skin width is 0.08, and min move distance is 0.

Thanks for any help!

One fix (have done it, but lost the code) for “not always grounded over uneven terrain” is to toss in an extra check: “if you were grounded 0.05 seconds ago, didn’t just jump.” Something like:

float groundedUntil=0.0f; // will be a game time

// movement code:
if(Time.time<groundedUntil) { // replaces grounded check

  if( jumping ) {
    groundedUntil=0; // "turn off" the grace period -- we aren't grounded
    ...
  }
}

grounded = .....
if(grounded) groundedUntil=Time.time+0.05f;