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!