x

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. 

[Closed] AIController clean up?

Stupid Question:

I assume its our responsibility to clean up AIControllers? I assumed that any actor that is dynamically created should be cleaned up.

I can see how player controllers should hang around so they can posses a new pawn. But AI controllers aren't really going to do that.

I tried destroying the controller from the pawn on unposses. Mostly as a stab in the dark. But it still lingers in the outliner.

My question is what is the ideal way of managing the AI controllers and ai pawns really? Basically AI dies, what should be the destruction pattern to follow?

Or is there a magic system to clean them up? :)

Product Version: Not Selected
Tags:
more ▼

asked Jun 17 '16 at 09:25 PM in Using UE4

avatar image

Answers.Archive STAFF
1.9k 206 313 684

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

The question has been closed Jun 17 '16 at 09:26 PM by AndrewHurley for the following reason:

The question is answered, right answer was accepted


1 answer: sort voted first

AIControllers without player state (default option, AAIController::bWantsPlayerState) should be automatically destroyed when pawn is removed. Check APawn::DetachFromControllerPendingDestroy() for details.

Since there's no concept of "death" in engine's pawn, it's limited to EndPlay, Destroyed, OutsideWorldBounds and Reset events. If your pawn should cleanup controller when it dies (and usually they do need it), it's best to add DetachFromControllerPendingDestroy() call in your death handler.

more ▼

answered Jun 17 '16 at 09:25 PM

avatar image

Answers.Archive STAFF
1.9k 206 313 684

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

Follow this question

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

Answers to this question