Skip to main content
edited tags
Link
DMGregory
  • 136.3k
  • 22
  • 247
  • 373
Source Link

Character controller falling with positive speed

I'm having very weird problems with my player's vertical movement. I'm using a Character Controller component with a capsule collider and no rigidbody. For testing purposes, I've ended reducing my jump script to just this line:

    owner.CharacterController.Move(new Vector3(0, 0.01f, 0));

When executing this script, the player should just fly upwards at a constant speed, right? Well, what ends up happening is that the player starts jumping in place repeatedly. The jumps are smooth, as if the movement was being affected by gravity. I thought that the standard Character Controller doesn't handle gravity automatically and you have to do it yourself, so I can't understand what's going on here. There is no other code affecting the player, if I comment that line it just rests in place. If I try a different direction (like (0.01f, 0, 0)) the player moves in a straight line in the provided direction as expected. But when moving vertically, weird stuff happens :S