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"

Destroy Enemy

Hello. I'm studying AI blueprints with Asher Einhorn tutorial on youtube and need to kill the enemy (not me) when I shoot de bullet on it. But when I do it, my players die instead of enemy. I tried to put a public variable of the enemy (AIShooter_Character), adding it to the target of Destroy Actor on CharacterBase (both have inherit from it - player and enemy), etc, but nothing happens.. The Enemy didn't die (in this case my player was alive). On below, like show the image, I left the code as it was usually when the player dies. With someone else can help me to fix this issue.

https://www.dropbox.com/s/stfubpgr8qkd2i7/Captura%20de%20tela%202016-06-07%2018.18.57.png?dl=0

Product Version: UE 4.11
Tags:
more ▼

asked Jun 07 '16 at 09:40 PM in Blueprint Scripting

avatar image

Tulk
88 1 10 14

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

If the Bullet or the Trace (whatever you use) you need to call the "Interface Message" and not the Function that has the same name (Node has a little envelope and Target Pin). Otherwise you execute the Function on yourself instead of the Target. For the Target of the Interface provide the Actor you Hit and everything should work fine.

Good Luck and have Fun =)

more ▼

answered Jun 07 '16 at 10:10 PM

avatar image

Nachtmahr
6.9k 143 24 168

avatar image Tulk Jun 07 '16 at 11:09 PM

I'm using Trace (sounds like Line Trace By Channel?).. Here's the another image. From PlayerShooter_Character:

https://www.dropbox.com/s/flcdsl2xuy3zas5/Captura%20de%20tela%202016-06-07%2020.05.17.png?dl=0

avatar image Nachtmahr Jun 08 '16 at 12:12 AM

Yes thats Correct and you are using the Interface correctly. You should also do a isValid in front because the trace can hit Nothing sometimes. Can you Print String the Display Name of the Actor you hit? If its your Character than you somehow manged to hit yourself (you can add actors to ignore self refference in that case). If its the Enemy than the Problem is somewhere else.

avatar image Nachtmahr Jun 08 '16 at 12:13 AM
avatar image Tulk Jun 08 '16 at 12:57 AM

Yes. Is hit my own character (player). I'll try to add some actors of reference and then, back with answers.

@Edit: Now I add actors to ignore self reference like the image below and I hit the Objects, Enemys with bullet, but the enemys don't die (disappear). '-'

https://www.dropbox.com/s/jfm02jikxd7gvd5/Captura%20de%20tela%202016-06-07%2023.07.40.png?dl=0

avatar image Tulk Jun 08 '16 at 06:01 AM

Now its work! Thanks a lot man =)

Here's the SS from this blueprint:

https://www.dropbox.com/s/ekhfk342zhw93qw/Captura%20de%20tela%202016-06-08%2003.00.31.png?dl=0

I was put the Target from Interface Message in new variable (wrong way) and not on the HitActor.. So it was working wrong.. fail.. Now just ajusted errors and all flows done well. xD

(comments are locked)
10|2000 characters needed characters left
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