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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

AI that spawns with player

Hey guys , i am using the fps starter kit and i already created an AI bot , but how do i make it spawn with a player and target enemy team? Any help would be great , note i am new to UE4 , so please be specific in answers thanks :)

Product Version: UE 4.12
more ▼

asked Aug 27 '16 at 11:34 PM in Blueprint Scripting

avatar image

yahya mroue
3 1

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

1 answer: sort voted first

Look for "Auto-possess AI" field in pawn class defaults/settings if working with blueprints, indicates moment when auto possess happens. This should have several options of when it should happen. Also there is a "AI Controller Class" which determines what AI Controller class should control this pawn.
With C++ situation is pretty much the same: enumerator AutoPossessAI (type: enum class EAutoPossessAI) and subclass AIControllerClass (type: TSubclassOf). Just set those variables in initializer of your pawn-derived class.
And AI Controller should be fully automatic, I mean Pawn shouldn't tell something to Controller, it's Controller should watch from PlayerState and Pawn "which team I'am in and who must I attack" according to this. If you need to change the team of some pawn you just need to get the PlayerState of this Pawn (if it's controller by someone, otherwise it will be null) and change team there, at least variable which supposed to determine that.

more ▼

answered Aug 28 '16 at 05:39 PM

avatar image

490 29 24 40

(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