Character teleports into sky to fall (walking off ledge)

Hopefully this is an easy one:

My AI-controlled character, while navigating the world, collides with a wall. The overlap is resolved, and the Character moved. A little along each axis (including Z, note).

Now, this causes a “Walking off ledge” event to fire, which seems like an extreme response given that the new position of the Character is definitely over the floor still (although maybe a little higher such that capsule is no longer touching the floor).

Then, what really baffles me, is that the Character begins falling - but not from where it is. Rather up in the sky, anywhere between 1000 and 10,000 units up in the sky (the unit’s size is only 100 uu’s, and the wall it collided with was only 200 uu’s in each axis, so this is a big jump).

Update: I found that it’s related to the wall being set as walkable. Still not totally sure about why the long-distance teleport is happening.

Update 2: One of my colleagues had set the walkable slope to 90 degrees. But why can the ant sometimes end up 10,000 uu’s into the sky?

Update 3: Seems that it is related to stepping. I noticed the “teleport” distance scales with acceleration, and that changing max step height on the nav mesh recast affects whether it happens or not. Seems that I’ve got something set badly which is making the step-resolution code catapult my character vertically when she’s going at high speed. Any ideas what I should look at first?

1 Like

Right, I found my problem.

The "Maintain Horizontal Ground Velocity was set to its default value of true. Now this might have been OK, but the slope that the unit went to climb up was at 90 degrees, and this caused the movement component’s calculations to calculate a horribly large delta on the z axis.

1 Like

Thanks, I had the same issue. Works fine now!