Simple back and forth Ai movement

I’ve been trying for a couple of days and I can’t seem to figure out how to make an enemy going from left to right to left to right to left… I’m trying to make a top down style game.

You basically need to indicate the “patrol” points and have AI go to one and then to another. The simplest possible setup could be this:

Cheers,

–mieszko

Is there something special you did to your pawn before, because I did the exact same thing and i cant seem to get any movement out of it. :frowning:

This works out of the box for Character-derived classes. Bare-bone Pawn misses some ingredients. Is that the case here, you’re using a plain Pawn?

Yea exactly. At the moment there is no character involved. You could say I’m trying to apply the patpatroling behaviour to a mesh in a pawn class.

It’s not something we support really. I mean you can pull this off, but there’s not out-of-the box thing that gives you just that. Try using a Pawn class with FloatingPawnMovement attached to it, this should work (provided you’re using 4.7.x)

I see we are getting closer x) is there any documentation on how to use the FloatingPawnMovement node?

It’s not a node, it’s a component. You need to add it to your pawn’s blueprint, or create a pawn blueprint first if you’re currently using plain pawn.

Ok, but where do I connect it? (By the way thank you for answering my questions so far)

You shouldn’t need to connect it - making your pawn have one should be enough.

Can you give me some examples, I can’t seem to grasp how to set it up :confused:

There’s plenty of tutorials showing how to add a component. Please look at those.

Finally figured it out, in the end I was only missing a navigation volume Thanks again for your help