Help with enemy ai

Hey, I’ve been fooling around, trying to make a 3d top down stealth game, but alas, the most important part, the enemy Ai. Each enemy consists of a sprite, which serves as a hitbox, as well a a controller, and an animated 3d model, which is for cosmetics only(unless you count using the animations as “states”). The goal currently is to have the enemy walk to a set spot, marked by an object, play an animation(look) then when the animation is done, patrol to a different spot. The events below work with one enemy in the scene, but once I add more than one, it breaks horribly. I can’t figure out what is causing the issue.


Thanks,
Inusitatus.

PS, i used to be imnotdream

IDK about your code but this is how I would do it. I hope it helps. I added a Boolean so the enemies don’t target the same location and I used a collision to prevent it from picking the current waypoint.

Try it. It’s automatic, no interactions. I didn’t feel like making a look animation. So, I just drew a spinning arrow.

Thank you so much, that was way quicker than I expected, I hope it works with all the “link objects” business.

1 Like