BP PawnSeeing: 2 out of 3 not working

I am working on a turn based top down strategy game.
There are three enemies and of course the player.

I dragged and dropped my one enemy actor three times into the editor. Everything works fine (movement etc) except the pawn seeing. Only the first of the three enemies correctly sees the player.

What’s up with that?!

Here is the blueprint for the enemy:

Thank you!

Try to remove the branch from OnSeePawn and just print a string if he sees you or not. If it works, then the branch is the problem.

Thank you. The Branch is the problem. It seems as if the variable “who is player” is not correctly set. Strange though, that it works for one out of three enemies… I’ll try to avoid that way of setting the player then.
Thanks again!

Glad I could help! You know, sometimes the the lesser issues are usually the game breakers heh.

Very true. I just need to figure out to distinguish between player and other enemies since in my game everything is AI driven. But I guess I could try “get all actors of a class” or something like this.

Well, that’s the safest way to do it. If your AI is a separate class from the player character, then making them “see” only actors of class player character should work. If you have allied AI fighting alongside you, then you need to setup some enums to differentiate the Allied index that has the player character included, and the enemy AI that will target everyone in your team.

Good luck!

Think of my game more in the lines of Pong and less Battlefield. Sooo no team, no allies fighting alongside. More simple stuff like “if enemy hits you, you die” :slight_smile:
I have to start small.