How to let pawn snap to ground when it's moving?

Hi guys

I’m currently playing with NavMesh, my goal is to let my pawn (a simple car) moving towards the location where I click on the map.

I’m using an AAIController and a custom UPawnMovementComponent to achieve this. I copied most of the codes from the UFlowPawnMovementComponent to my own implementation for now, but additionally inside the TickComponent(…), I’m updating the pawn’s direction with its velocity.

Now, most of it works as well, but one thing I can’t accept is when the pawn moving, it’s really ‘floating’ in the air, or ‘sinking’ underground, and I have no idea how to make it snap on the ground.

Please if anyone can point out my mistake, or is this idea not correct from the beginning?

Thanks for any help!

I will post some screenshots and wish they can help me to clarify my question:

This is the car and the map, the car should move to where I click on the map. the map has a somehow working navmesh.

But when the car is moving it floating over the ground, especially when going upstairs.

And when it’s moving to a lower location, it will sink into the ground.

I’m aware the navmesh is a little above the ground, is this the reason the car pawn behaves like that?

if your mesh can morph you can use morph targets in the moving animations to fix that, that might look weird with a tank though. alternatively, you can setup your tank as a character instead of a pawn and that should help as the character movement component will always snap the capsule to the ground

Thank you @ViceVersa, I’ll try this, but I still have a little confusion: is this means the tank has to use a capsule as its collision shape? That’s kinda weird…