AI Move To command question

I have a spawn system that spawns same AI actor class(let’s say skeleton) repeatedly/looping. Now, I set this Enemy actor to AI Move To my Player Character actor to my BeginPlay Event on the enemy’s BP. I didn’t use the complex AI system because the enemies’ goal is just to get close to the Player Character and attack when they are in the attack range.

The problem is AI Move To doesn’t work when they spawn and I have to put a delay of 0.1 sec for it to work, problem solved, but it seems like every time a new skeleton spawns the AI Move To command get’s executed to every skeleton currently in the map so there are times when the skeletons are just roaming around executing AI Move To repeatedly and won’t get close to my Player Character. Should I use the complex AI? Will this resolve my problem?

I should also mention that I have another command that calls AI Move To again but only after they finished an attack animation.

Hi there @Akimikage,

Hope you’re well!

This topic has been moved from International to Programming & Scripting.

When posting, please review the categories to ensure your topic is posted in the most relevant space.

Thanks and happy developing! :slight_smile:

Hey @Akimikage!

Can you show us some screenshots of your AI controller (if you’re using one) and your enemy skeleton BP? That’s really the best way we’re going to be able to help :slight_smile:

Hey @Akimikage

Using a behavior tree is always better, so you would have no issues after spawning them.

After creating a behaviour tree you can basicly spawn the AI with the node below.

1 Like

I switched to the behavior tree and it resolved the problem. Thanks :slight_smile: