Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to change player character from AI Enemy example?

The tutorial https://forums.unrealengine.com/showthread.php?25073-UPDATED-12-20-A-I-Templates-Bot-Car-amp-Flying-AI/

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).

Product Version: Not Selected
more ▼

asked Apr 02 '15 at 11:38 PM in Blueprint Scripting

avatar image

508 33 48 85

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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!

more ▼

answered Apr 02 '15 at 11:58 PM

avatar image

201 14 26 41

avatar image unit23 Apr 03 '15 at 12:00 AM

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

avatar image CharlieTheTall Apr 03 '15 at 04:22 AM

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.

avatar image unit23 Apr 03 '15 at 11:12 AM

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

avatar image Naitguolf Sep 04 '15 at 03:42 PM

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?


(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question