Making Widget Stay at Spawn Location

Hello am trying to setup floating combat text and I got mostly working. To show problem I currently have here is a video of how it is currently works in game Floating Combat Text - YouTube. Notice how it sticks to the screen. What I want to do is keep it at the location of the damage actor. Here is a picture of my current setup for creating this widget.

Perhaps converting it to screen location is causing the issue.

Add a widget component in the components tab and in the details panel, add your widget class and change the space to Screen.

Either use a widget component as suggested above or update the text position during tick for each hit entity. Each enemy should spawn a widget, store its reference, track it in screenspace and eventually remove it, freeing up the memory.

this does seem to work but it doesn’t add on to the current text it just replaces

This sounds like a good solution just not sure how to get about tracking the current enemy the widgets on and changing it’s position

The same way you’re doing it already but on Tick:

Just an example, if you need to keep track more than one pop-up per actor at a time, add them to an array and loop.

Image from Gyazo

Alright So this works tho it’s not creating it at the actors current position here is a gif of it https://i.gyazo.com/cb8b0d9c57d1539503718f99fa345847.mp4
here is a screen shot of my code am using to update it’s position

In the example above, what is the actor you’re hitting? Where is the actor? In the attached gif it seem you’re hitting the ground so the widget is tracking it. It seems you’re handling this logic outside of the entity responsible for displaying the widget. Do tell if I misinterpret what I’m seeing.

Unless you have a specific reason, it would be easier to follow the logic mentioned above:

Each enemy should spawn a widget,
store its reference, track it in
screenspace and eventually remove it,
freeing up the memory.

Each enemy should handle its own widgets, when they get hit perhaps - as in the attached example. I guess you could keep track of all hit enemies and all their widgets elsewhere but that would just muddy the water.

In the example that actor getting hit is the player. The actor get’s set in this function which I have setup in a blueprint function library so it can be called anywhere. This function get called whenever a actor takes damage. It gets the damage actor and creates a ref which then sets the ref in my tracker bp.

here is the setup function that spawn the tracker actor. The Floating Combat Text Tracker is where the text widget is created.

My end goal was to make it so I can apply this text to any actor of my choosing. Like the player or an npc. Without having to copy code a billion a times.

Alright got it working just copied my floating combat text into all actors that can be can damaged thanks for the help

Alright got it working just copied my
floating combat text into all actors
that can be can damaged thanks for the
help

Consider looking into inheritance so you do not need to duplicate any code. This will also allow you to easily maintain the code further down the line quite efficiently.

Good luck with the rest.