Download

Ability BP Getting Very Cluttered

For now I have my player abilities have a ‘on overlap box collision’ trigger to cast to ‘Enemy Blueprints’ to set the enemy ‘Damageable’ bool to true and then do damage from there. See example of explosion ability below.


This returns ‘none’ whenever I test this out because of the Sequence node I used so all my 50+ enemies are tethered to one event trigger. Example shows the first 3 enemies. Im not sure if this will cause problems down the line since everything is working the way I want it to. How would you make this BP flow more efficiently/effectively before I add my other enemies?

Hi, if all your enemy classes are derived from a single Parent class, then you can have the Explosion function in it. This way all that you have to do is get the Other Actor pin of On Begin Overlap, Cast to the parent and then call Explosion.

If there are multiple parent classes, I would suggest using an **Interface **(https://www.youtube.com/watch?v=G_hLUkm7v44) with a function to handle the setting of Damageable bool before calling the explosion. Instead of casting to each type of enemy separately, have all enemy parent classes implement the interface & its functions. You can then get the Other Actor pin of On Begin Overlap and call this interface function.

In either case, you won’t have to check with all 50 enemy types. So no matter how many enemies you choose to add in the future, the execution will work regardless.

Thanks @Storm. I did what you said and its working a bit better. I just ran into another problem. So I have the enemy class with a HitBox collision box being inherited to all the Children. So i want the explosion event to be called only when the hit box is overlapped. Instead, the fireball detonates and damages the enemy when it overlaps the player detection radius. What ive tried is:

  • Get overlapping actors
  • Get all actors of class
  • Get components by class

I have mix and matched the above with Branches, Sequences and isValid nodes but my fireball still either dosn’t detect the HitBox of my enemy or detonates too early. What do you all think I am doing wrong?

Thanks @Storm. I did what you said and its working a bit better. I just ran into another problem. So I have the enemy class with a HitBox collision box being inherited to all the Children. So i want the explosion event to be called only when the hit box is overlapped. Instead, the fireball detonates and damages the enemy when it overlaps the player detection radius. What ive tried is:

  • Get overlapping actors
  • Get all actors of class
  • Get components by class

I have mix and matched the above with Branches, Sequences and isValid nodes but my fireball still either dosn’t detect the HitBox of my enemy or detonates too early. What do you all think I am doing wrong?

Capture.PNG

Is the player detection radius another sphere collision component?

Yes. The PlayerDetectionSphere is another collision comp. It is attached to all enemies in the ‘Class_lesser’ class and has a wider radius than their Collision Hitboxes.

Alright, cool. So I think what’s happening here is that the PlayerDetectionSphere has the Fireball’s “Object Type” (you can find it in its collision settings) set to overlap under the Object Responses part of collision settings. We will have to set it to ignore. It would be easier to explain if you shared the collision settings for both.

Hey hey. Thanks! That seemed to do the trick! I didnt need mess with the Blueprint from my first post and just changing the Object Type of the enemy_PlayerDetectionSphere and the Fireballs Explosion Trigger Sphere to the below settings. Ill post them just in case anyone in the future has the same problem.