How to change player character from AI Enemy example?

The tutorial [UPDATED 5/16] A.I. Templates - Bot, Car, & +Flying AI - Programming & Scripting - Unreal Engine Forums

Attack/Search/Patrol TPP A.I. (Version 4.7.0) by Peter L. Newton, is working, but when i change the player character of the actor class in BTW_botDetectEnemy, the AI no longer attacks.

1. Anyone know what is missing, how can you change the player character with keeping the AI functioning?

2. Also i tried to change the enemy, and even simple duplicating the enemy blueprint, changing the mesh, seems to break things, (the duplicate enemy AI no longer attacks).

Yes, I’ve changed the pull down (actor class), and it is not working.

In the BTS_botDetectEnemy blueprint, there is a GetAllActorsOfClass node and it’s specifically “getting” the MyCharacter class objects. Since there’s only 1, it just returns that. If you create a new player character blueprint and use that, then the GetAllActorsOfClass is going to return 0.

Just change the pulldown in that node to look for your player character class. There might be other Tasks, Decorators, and Services that you need to look in to make the same change. Hope that helps!

It works fine. You can make it attack the RotatingBox. select the RotatingBox from the class pulldown on the GetAllActorsOfClass node in the DetectEnemy script. Then in the MoveToEnemy and AttackEnemy script there is a CastToCharacter node. Change that to a CastToActor node in BOTH of those scripts.

If you can get it to attack the box, you can get it to attack your own character.

Try it yourself with characters not from the AI map. Not working.

I also have the same issue. The AI it doest attack my own player character. Did what you said to change, but it stays without doing anything. Can you please help us?

Regards.