multiple different bullets overlap the same triggerBox in ue4

I only use 1 unique playeCharacter for all 3 maps in the game
Every enemy is different, every enemy use a unique gun with a unique bullet

I have 3 maps
in MAP 1 there is only ENEMY 1
in MAP 2 there is only ENEMY 2 and sometimes ENEMY 1
in MAP 3 there is only ENEMY 3 and sometimes ENEMY 1 or ENEMY 2


the problem is in MAP 2 ,this is the blueprint of the PlayerCharacter, when I try to cast the bullets,

however i got this error

How can I configure with blueprints something that allow my PlayerCharacter receive different bullets from different quantities of enemies at different times and different maps?

Add an isValid node before the casts.

You can also opitmize the code by

  • make the bullets have a common base class and test against that

  • have the bullets implement a common interface and check if the actor iplements the interface.

1 Like