Stop friendly-fire between enemies
Hello, I'm creating a game for practicing and learning porpuse. The thing is the enemies walk to me and attack but if another enemy is next to the one attacking me he get damaged too.
I tried to "filter" the attacker in the Apply Damage node by the Instigated by pin but I can make it work.
I have my character done in an actor BP and there is 2 types of enemies, that are childs of my character BP.
I someone needs I'll post screenshots of my BP, just ask for what you need to see.
asked Apr 20 '19 at 12:34 AM in Blueprint Scripting
I had a similar concern and here is how I dealt with it (please note that I am a beginner with UE4 BP scripting as well) :
What I would do is have the base class (`Character BP` in your case it seems) have a boolean
Use the instigated by pin as you yourself suggested and get that
That looks a bit like this (in my case they all are
You could encapsulate it in a function you call each time you try to deal damage and bypass it for the events for which you don't want to ignore friendly fire but that may be out of scope of the question.
I would recommend that you do NOT make your enemies inherit from your
answered Apr 20 '19 at 04:00 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here