Text Displayed on map during combat

Hello everyone,

I am in the middle of developing an Action RPG battle System and so far everything is working besides displaying the damage dealt (Float variables or Integers). I would like to make them appear and fade out in a way similar to this:

It would be fantastic to have some help on this or at least be pointed in the right direction!

The way I would like to do this is,

When damage is applied, it plays a fade in effect, displays the damage, then plays a fade out effect. it is displayed near the point of contact, so maybe It could be attached to a socket on the player where the damage dealer would be and maybe a bit of random offset in the case of an attack that strikes more than once.

Any help would be fantastic!

You basically get the location where you hit your enemy and use the “Project” node to convert 3D coordinates into 2D screen coordinates. If you want a randomized location around the hit point, you can always add a random integer to the projection location. For fade-in and fade-out effects, you’ll have to do some kind of interpolation with the texture transparency.

This seems like a pretty daunting task to figure out since my knowlege of materials and textures are a little weak and I’m not sure UMG would be able to achieve this effect. I suppose I can figure it out with UMG, but the issue I ran into (after trying this out) was that casting to the widget always failed.

You may can use a text render (not sure of the best place character or enemy, need some tries) with particles added and a set location based on component hit or hit location or random. Not sure you can fade but easy way to have something fair working time to find better. With umg you could have a look at 3d widget and same idea : set location and add particle at same location Creating 3D Widgets | Unreal Engine Documentation

Hey Liondog, great idea! Have you made any progress with this?

I’m not sure that’s as efficient as using the Project node. Plus, using a Text Render will make it so the character blocks the output number (of damage or whatever) while if you draw it from the HUD using the Project node you’ll see it drawn on top of the screen like what’s shown on that FFXV screenshot.

I am actually at the point where I am working on this again. My project broke when I upgraded and I had to fix a lot of things, but I will let you know. So far I can say this. I am going to handle this inside of the player and the enemy Damage to the enemy will be handled in the enemy and damage to the player will be handled inside of the player. This is because I am taking the incoming damage and then working it against the def and other attributes to determine the final damage inflicted within the target itself. That way I wont have to do too many casting. Doing this with UMG does not seem like a good way to go, but I’ll figure it out.

The concern I will have down the road is party members and if their damage to the enemy and damage to them should be displayed or should it just be the player character. If party member’s damage is displayed, I might have a problem with the text size over distance.

Haha. It’s two months later and I’m coming back around to this topic, again, myself. I have never been able to get the project node to function correctly, though.

I ended up just creating a dynamic material instance that spawns above the hit location. I’m able to control the fade in/out, create a flicker effect over the font, set the font size based on distance and ultimately get the look I want - the only problem is, as Keytotruth said, it can be obstructed by other objects. I hate to rebuild a solution that [mostly] works, but I have a feeling the project node is the way to go, if I can ever figure it out. At this point, I’m nearly convinced it’s broken.

I would imagine, not knowing anything about your game other than what you’ve mentioned, that you would really only want to show the player’s damage amounts. Right?

Actually I fully got this to work utilizing UMG! Maybe we can combine our knowlege. I have it spawning in a random range around a point which is the player (if it’s damage to the player) or the enemy. I add it to viewport (there’s no canvas for the widget) and then I have the location it should appear updated every .50 using a timeline for optimization. I add it when it should appear and remove it seconds later. With it being in screen space it can not be obstructed.

At the moment it may be some work trying to convert the location over to hit location and then randomizing it a little, but my way works 100% and you can control the look of it via UMG. I’m really busy trying to make the final touches to my game before April 24th, but I will try to make a tutorial if you need it! Just let me know!

I made a Floating Damage Text system in my Hack n’ Slash.

It looks like this:

It appears when they take damage, full opacity. Then they start fading and going up (like Diablo 3).

I did it by creating a UMG text (anchor at center of the screen, let’s say Floating_Damage_HUD) and an invisible actor (let’s say Dummy_Actor_Damage).

When I hit an enemy, I spawn a Dummy_Actor_Damage as Child of the enemy hit and at his position. On his Blueprint, I call the spawn of Floating_Damage_HUD (“add Widget”).

I give the reference of the amount of damage to display and the fading time is set to 0.3 for all Floating_Damage_HUD.

On the Floating_Damage_HUD I binded the “Opacity property” which is equal to Fade Time Remaining / Total Fade Time. I also binded the Translation of Floating_Damage_HUD in order to make it move to the top of my screen.

I think my method is really messy and you can achieve the same thing without spawning an invisible actor that carries the UMG.

So, here I am again! I’ve taken your advice and created an animated UMG widget and have it successfully showing damage values onto the screen. I have two issues, though. One, as you’ve said, I’m still trying to figure out how to randomize the hit location projection on the screen. Currently, I’m just using a canvas panel with text box anchored to the center of the screen and since I’m using the ‘Add to Viewport’ node, I can’t see any way to also include the ‘Project’ function. The second issue is how to spawn a UMG widget as an instance. Right now, each time the widget is spawned, it just updates all the previous iterations of itself with the most recent hit value, instead of creating a new widget instance.

Here’s an example of what happens when I burst-fire - each shot *is *actually a randomized value but each time the widget is called, it updates all the iterations with the most recent random value. Any thoughts?



Ahh, ok. So I just solved one problem. The ‘instance’ issue was working fine but I was calling the damage value from the ‘GetText’ function, which was bound to a text field in the widget. This apparently updates every tick and once I moved my nodes over to run on construction only, it works perfectly.

Now, to add some randomization to the screen space where the widget is spawned…