Limit movement on X and Y axis

I have a BP class that inherits from Pawn and I’m trying to move it to a position without using any AI (I’m learning Unreal).

I have created this function:

And I call it here:

This is its initial location (it doesn’t float in the air):

And here, when it is moving to the character:

Do you know how I can limit the movement on XY plane?

You could break the Vector and only work with the X and Y values.

1 Like

I have found a solution.

If I use this function:

it doesn’t fly.

But I connect the Z value, it flies:

And I don’t know why it modifies the Z value. Maybe it is something about the Floating Pawn Movement Component.

This component has an option named “Planar Movement” but I haven’t been able to limit the movement in XY plane.

There has to be a somewhat bette solution to that, but unfortunately I’m not that experienced with such Blueprints or the Floating Pawn Movement. :nerd_face: