Player Constrained Particles
ฝัง
- เผยแพร่เมื่อ 9 ก.ย. 2024
- In this video we have a look at how we can make a simple scratch module to constrain our particles to a player location - great for things like dust in open world games.
Apologies for missing half my head - green screen issues!
If you want to learn more about Materials in Unreal Engine check out my new course here:
tharlevfx.gumr...
If you have any questions about Game Art VFX or the Unreal Engine then email me: tharlevfx@gmail.com
Or you can find more tutorials on my website: www.tharlevfx.com
or check out my work on the Unreal Marketplace:
www.unrealengi...
or follow me on Twitter: @tharlevfx
If you'd like to support the channel then follow me on Patreon: / tharlevfx
For UE5 as of May 2023 you'd use a BREAK POSITION instead of BREAK VECTOR and MAKE POSITION instead of MAKE VECTOR since it wants to keep positions separate from vectors now. Also, as someone else noted, with the IF module being deprecated, you'd use SELECT modules with NiagaraFloat values for the Wildcards.
Thanks for the updates!
Also think the inputs for the if node are flipped as his top inputs go in the bottom and so forth. Seemed to work for me now on 5.2! Thanks for the heads up!
Make sure Emiter "Local Space" is off
And the --- Shape "Box Size" is two times the size of --- Keep to Box "BoxSize"
great tutorial I've been trying to figure this out, thank you!
you can also "wrap" the 3 axis at once, and without using an "if" :
Transform your space to be centered (0.5) on the player position, divide it by your radius size, and use a "floor" on this transformed particle position to teleport it (and then do the inverse transformation to get back the true particle position) :)
Personally I used the normalised range node within the scratch as we get that info later anyway, use the normalised vector and get the inverse and multiply by the range, add the owner position and use the "within range" in the IF statement to use current pos or new pos. You're normalising the range +/- between 1-0 right?
i knew there'd be some better options in terms of the math but i just wanted to keep it simple for the scratch module as a proof of concept. Thanks for the alternative methods though - i'll check them out!
@@tharlevfx it's a great intro into the concept! So really great work it was only after watching it I thought about trying other methods or simplification. This is what scratch pads are great for, everyone will be using it slightly differently. Perhaps for rain you'd want to respawn the particle at a higher Z position so it can fall etc. But this is why I am hesitant to release my tutorials as people only seem to want to know the final answer not a basic recipe for ideas
@@floorpeas i know what you mean but i think if you explain things as you do them people will pick up on it. and the people who just want the answers can just follow the steps to get to the end result. it's hard to please all the people all the time :)
@@blastforge The Normalised Range Node also uses an IF and sqrt. You can solve this still by using modulo and it should be way faster. I'm sorry I can send you a link to the function because YT shadowbans me if I do. You need to suptract the owner pos from the paricle pos. then add half the bounds. then do actual modulo function between the calulated value and the bounds for the divisor (not unreal engine internal modulo its wrong). Then you subtract half the bounds again and add the owner pos again.
Awesome! This is just what I needed for my underwater effects. Thank you. Works well in UE5.
I'll keep this video in my "useful things" playlist
great tutorial thanks! works
Definitely Interesting and informative ! Big thanks for that!
Thank you :)
Awesome tute as always!
Thanks for your lessons! Tell me, is it possible to animate Kill Particles in Volume when imposing particles on a model? If I set a fixed value in Z, then the part of the model with particles is not displayed, but if I try to animate in Z, then nothing happens. There is no dynamic hiding of particles that are attached to the model (static). I really hope for your help.
How can u know all this?
your head is completley empty, i can see through that huge hole in your head
Thank you for the teachings though
hope u find a cover or a hat
Great tutorial! How can one make particles partially disappear when going under overhangs/roof/indoors (preferably on CPU and without doing expensive raytracing) ?
Strangely enough, I am getting an error in the scratchpad (script failed to compile) with UE5.0.2: Vector VM compile failed. Errors: /Engine/Generated/NiagaraEmitterInstance.ush(212): error: syntax error, unexpected '}'
Using 5.3.1 I got to the point where you added 'Keep to Box' to the emitter, it's not appearing as an option. I can add 'Shape Location' but that uniformly moves the box of particles. Has that been changed like the vector information?
Keep to Box is the name of the scratch module we make at the start of the video
@@tharlevfx Well, I feel both dumb and satisfied, thanks!
Super useful. But somehow, I don`t have the "if" node :)
the if node has been replaced by the select node in latest versions - same functionality but more
@@tharlevfx Thank you! Yep, figured that out and was able to finish the lesson. Thanks again, good job. It`s a pleasure to listen to your videos, everything is short, understandable and efficient.
This maybe a bit late and I hope you are still taking questions, but how do you attach the particle system to a player? Everything you showed is working well, next I need to attach it to my FPC (First person character) so that where ever my player goes it is snowing.
You can just add the particle system to you character blueprint and attach it there.
nice one