Agent won't move in y direction

Hi there!

I am trying to have an agent follow a path on a grid graph but it just won’t follow along on the y axis. The Path, as visible on the screenshots, is calculated correctly.


Below are the settings for the Astar and my agent:


I tried fiddling the the gravity settings, both in the AIPath component and in the rigidbody. I tried setting putting the the rigidbody and collider on a child object and the AI components on the root.

When the rigidbody is on the same object as the AI components then the agent is simply stopping at the edge not even slightly going upwards.

I have honestly no clue what the problem is. Please, help.

Hi

I don’t know what kind of rigidbody configuration you have, but I would guess that the rigidbody prevents movement because the surface is too steep for it.
A CharacterController might be able to handle this better.
Or just using no rigidbody at all.

Hi Aron,

Thanks for the reply. I indeed got it to work with a Character Controller. Thanks for the tip.

Do you mind explaining how A* works under the hood ( together with a character controller) though? I don’t quite understand why A* does not work with a rigidbody (without gravity). Shouldn’t it just follow the path just as well?

Best regards,
Dan

Hi

As the rigidbody moves forward, the colision will push it back, and gravity will then make it move slightly downards, to ultimately end up just where it started. This is what I’m guessing at least.
Note that you have gravity enabled on the AIPath script as well.

Thanks Aron, that makes sense