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 do i make friendly Ai attack enemy Ai in unreal engine 4??

I am working in a historical shooting game, i finished all the shooting and attacking animations for the Ai but i cant get to make the enemy attack the friendly Ai and the game then just started to look retarded

Help please

Product Version: UE 4.15
more ▼

asked Mar 28 '17 at 08:13 PM in Blueprint Scripting

avatar image

1 1 1 1

avatar image TheDimand Jul 21 '17 at 10:34 PM


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

1 answer: sort voted first

I would recommend having a tag on each Ai actor that represents their 'team'. Then when you are selecting a target to fire at, only select targets with tags that that Ai considers to be an enemy.

Another way to do this would be cleaner if all your Ai classes were somehow related in the class hierarchy. Find their common ancestor, and add a field that is an enumeration type denoting their team. Set this somewhere reasonable (likely in a child class that represents a member of one team). Then when selecting a target for attack, you'd cast any candidates to the type of the shared ancestor, if the cast succeeded check its team, then decide what to do appropriately.

more ▼

answered Mar 28 '17 at 10:30 PM

avatar image

427 20 96 123

avatar image JRV1 Jun 13 '17 at 11:47 PM

Can you post a BP example of this setup?

I have an AI, an Attack event, but I would like to make friendly AI from that.

I've duplicated the AI controller and blackboard and called them friendly, is there a simple change in these I can set the enemy as the target and the player as friendly?alt textalt text

friendlybb.png (16.3 kB)
friendly.png (247.9 kB)
avatar image der killa Dec 10 '17 at 04:37 PM

could you make the picture in a higher resolution, please?

avatar image Mrminecraftwizz1 Aug 14 '18 at 12:26 PM

I need help with this also

(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