Floating Damage & Healing Text Using Niagara In Unreal Engine 5
2022 ж. 21 Сәу.
12 319 Рет қаралды
I'll show you how to build a simple and versatile "floating numbers" system to represent attack damage, spell damage, healing or any other events in your game!
Download the digit textures used in the video if you don't want to make your own:
drive.google.com/file/d/1QzsM...
Thank you, as always, for making these tutorials. Each one helps me better understand the UE5 engine and all the things it can do.
This was a great tutorial. The step by step and error encountering is great.
Always Something New Tutorial Thanks🤩🤩
Wow this was very cool! Awesome tutorial!
This was a great tutorial! I think I'm going to implement this feature into my project today ^__^
where is the OUTPUT SAMPLE TEXTURE SampledColor ? doesn't show up.😭
Great tutorials mate!
Amazing stuff! Thanks a lot!
Wow I figured it was going to be a simple tutorial but its crazy
Great tutorial!
Hey there! How did you implement the particle effect for the fade out on the numbers that you showed in the preview? It'd be great to get an explanation of what Niagara settings you used.
this is a great tutorial, i dont supose you would happen to know how i could implement this into the marketplace asset survival game kit by any chance?
Many thanks for this! It was exactly what i was looking for but when the numbers are displayed how do you keep them facing the player??
Did you find a solution to this? Cannot figure it out...
Thank you for the tutorial! For me, I had to add a "Color" node under "Particle Update" in Niagara. Otherwise, the numberswould just be shown white, strangely enough. I followed the same steps as in the tutorial setting the Color mode to Direct Set in Initialize Particle..
Thanks for letting people know, I had the same problem.
Thanks for sharing this! I was having the same issue.
You need to uncheck "apply Sampled RGBA to PArticle Color" checkbox in the Sample Texture model in Niagara Emitter
@@peterhall4216 You need to uncheck "apply Sampled RGBA to PArticle Color" checkbox in the Sample Texture model in Niagara Emitter
is this possible with float values? also wouldn't be better to use a map instead of a switch?
any tips on how to make a waterfall with niagara that has collision and not gets killed when occluded since its gpu depth buffer collision?
It seems that in later versions of Unreal engine 5 they removed the user param button in the Niagara system emitter. Do you have an example that works in this situation?
I found at the bottom left the tab user parameters and there I clicked on the + Icon to add the parameter
How might you go about doing this with dynamic text, rather than a small number of individual digits in a hardcoded font? Would it be possible to draw text to a render target and utilize that texture for the floating number?
Hmm I will check into it for sure! Otherwise for various text and fonts you might use a UMG widget based approach instead.
Is there a way to do this with the NS system set to CPU instead ?
Thank you very much for the lesson! Please tell me if you know if there is any way to make this replicated for a dedicated server?
Will this replicate for multiplayer?
anyone know how to make the texture smaller ?
Great idea. But still wondering why particles are not facing the camera by default without the necessity of rotating the system.
Because the particles you are spawning are on the grid and the grid doesn't rotate without the additional code. The particles themselves are facing you but they're so small you don't notice. Every single number you see is made up of 256x256 particles in the grid.
when you are searching for the sprite, you can just click the FolderMagnifying glass icon next to it in the details pane. rather than search for it
Thank you! I always forget you can do that.
@@buildgameswithjon7641 you bet. This tutorial was great. I was working on a project and was implementing blast damage and I got tired of debugging manually so I took a quick detour to do this to easily see when damage applied to nearby actors.
This is going to be really resource intensive, and I can't see what the benefit is, when you can just spawn a UMG widget with some text in it. You even mention this in a comment. If it's really important to have particle FX, like if you wanted text to drift away like smoke, sure, use Niagara. But for numbers that appear for just over a second, no player will know if you use a widget versus anything else. But they certainly will know when their FPS drops because the game has spawned dozens of emitters and thousands of particles.
From what I've read you might be wrong in thinking that widgets would be more efficient. The consensus of my internet research seems to think the widgets are more exepensive than niagara. I'm not an expert tho that's juste what I've read trying to compare both solutions. Also I believe Lyra does it this way.
It is indeed expensive. I've tested this on multiple damage events at once, hitting 20 targets at once and each hit triggering another hit in a 3 meter radius, suffice to say it hitched like mad, dipped into the 10 fps ranges, spawned millions of particles at once, not great. There is however a way to make this much cheaper than even widgets. 1. First thing you have to fix is the GPU bottleneck, the sheer number of particles and all the alpha testing they do. To fix this I tried lowering the scale and reducing the number of particles but it still wasn't enough, so I decided to ditch showing particles and using meshes for each Digit. Modelled them out in blender After doing this, I solved the GPU bottleneck by spawning a single particle per digit using meshes in the mesh renderer, however now there was a CPU bottleneck because of the sheer number of systems this spawns, because you're getting a system per digit which is bad. 2. Using the spawn particles in grid and making the X count a user variable I managed to fit the entire number from my damage system into the grid count, so it spawned a single niagara system, as opposed to one per digit, with as many mesh particles it needed to display the number. Doing the same stress test again only resulted in a 1-2 ms spike on the CPU which is more than acceptable considering the sheer number of damage events I was triggering. Setting this up is a bit tricky, you'll have to add all the digit meshes in the mesh renderer, then in initialize particle you have to set the mesh renderer array visibility to direct set, then the mesh renderer mesh index to select int from array, then the array sampling mode to direct set and the direct array index to generate int from counter, then set the intial value to -1 so it starts with the right index. In the end transform the int selection array into a user parameter where you'll have to use that, together with the user parameter you've made in the X count of the spawn on grid and do some blueprint logic to tell the system how many to spawn and what int to use from the array for each digit depending on the numbers you send it from your damage system. Bear in mind that using meshes instead of multiple sprites to form a texture will greatly reduce the ways you can animate your particles, curling, fading, exploding away etc as you're only spawning a single mesh particle per digit, for me it's a good trade off because of the performance gain. I can use material magic to make the numbers animate in a fancier way anyway. Thank you @BuildGamesWithJon for the initial idea!
@@sephtv2759 for one use is great....
@@sephtv2759 thank you for this.
Great tutorial!