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 destroy an AI controlled character by pressing a key?

Hello everybody,

I'm using a ThirdPerson template. I've imported a character from FUSE and assigned the mesh to the ThirdPersonCharacter BP. It is controlled by an AI controller BP which I've set with a "MoveToLocation" node. In addition, I would like the character to be destroyed when I press a key by using a "DestroyActor" node, so I've put the node in the ThirdPersonCharacter BP. The problem is that if I set the "Auto Possess Player" setting to "Disabled", the character execute the Move to Location, but won't be destroyed; On the contrary, if I set it to "Player 0" the character will be destroyed when I press the key, but won't move to location. Any suggestion? Thank you.

Product Version: UE 4.21
destroy.png (399.9 kB)
movetolocation.png (91.5 kB)
more ▼

asked Nov 21 '18 at 03:05 PM in Blueprint Scripting

avatar image

1 1 2

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

1 answer: sort voted first

your issue here is that the move to is for a ai controller and when you auto posses you are possessing the character with a player controller. if your trying to have this character as an enemy and destroy it from your character then you should get a reference to the enemy in the player character and do the destruction from there. then again it looks from your picture that you are working in two different event graphs so its hard to tell what your trying to accomplish

more ▼

answered Nov 21 '18 at 03:16 PM

avatar image

10.1k 33 10 25

avatar image VR_Lab Nov 22 '18 at 11:31 AM

The fact is that I don't have a player character, but just a VR camera from where I watch the Bots moving (research purposes). So I have substituted the mesh of the default mannequin (ThirdPersonCaharacter) with that of the avatars I am interested in. Then, I have created an AI controller BP which I have set as the "AI Controller Class" of the ThirdPersonCharacter. I hope this will make it clearer. Anyway, thank you for your answer. Please, If you have some images to show, that would help a lot, thank you!

(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