Getting variable from different instance of actor

Hey guys,

So im messing around with the first person shooter template. Created actors that are enemies and gave them a health pool. I wanted to create floating damage numbers which I did in probably an incredibly jank way.


All in the enemy’s BP. When an enemy takes damage they save the damage taken as a variable (damage amount). then spawn an actor which displays that damage value.


All in my Floating Text BP. This works perfectly when there is only one instance of my enemy but any more than 1 and all of them besides the first to spawn just display the last damage the “original” took not the amount they should have took.

Does this have something to do with using get actor of class instead of all actors of class? Any help would be appreciated. I am brand new to Unreal and Blueprints.

TLDR: one instance of my enemy shows correct numbers. rest show default if shot first, last damage of “first” enemy if shot 2nd

No need to spawn additional actors (expensive!) or GetActorOfClass (that’s currently the problem).

  • each enemy has a widget component
  • when they get hit, their own widget shows their own damage:

The above goes into the Enemy blueprint.


And once you’re ready for something more funky:

1 Like

In your “funky” example:

Are the variables Screen Loc, Dmg Val. set up in the widget? How do I go about setting up a variable in a widget? If its even possible?

Cheers for the help mate.

You probably mean this.

How do I go about setting up a variable in a widget? If its even possible?

It’s just another blueprint with a normal graph: