Well, Generally, I’m trying to replace all BP casting with BP interface, some of the stuff I’ve replaced already.
Now I’m trying to do the same with my projectiles that cause damage. I replaced part in player BP like that. Projectile gets HP and then changes it - works well.
But the question if I want to do such things that aren’t connected with the damage system, how can I do it with multiple targets, how to identify them to send/receive data properly
In my case it’s AOE damage, in this case I don’t have one target
I tried to replace cast to the BPI and it doesn’t work for enemies
It works well for single player BP
Here the projectiles have an overlapping collision sphere - anything trapped inside when it hits (whatever it hits) is sent a message, here filtered to one class only.
Thanks, I see that you did it in opposite way - you are sending damage from projectile and than in the pawn you are decreasing health.
Will try your approach, hope it will work
Why would you even use Get All here? is the goal to really hit ALL actors or the ones affected by the area damage only? it may be intended, I just hate the node for my own private reasons
How many actors of BP_TargetPawn2 class are in the scene? It returns what’s in the filter.
I don’t know alternative way. Yes, I’m trying to hit anyone in AOE, so I decided to get all actors and then check the distance from the position where projectile was blown.
For now I have 2-4 enemies for testing purposes.
The strange thing, If I call the same inside player BP it gives me all BP_TargetPawn, but in the case of BP_Projectile it gives only one of them
It sounds interesting, I’m going to rework AOE, earlier missed that it doesn’t work with multiple targets and still don’t know why get all actors of class doesn’t work properly for projectiles, I checked, for each loop node never completed
Finally made this.
Overlapping works well, also found the reason why I didn’t get full list of actors by using GetAllActorsofClass - it’s because Loop Body was connected with function return node.
So, now code is clean and compact
BP_projectile AOE function