How to mask a particle effect (only show particles in flashlight beam)?

Hello
I am very new to masks and I have a flashlight where I added a cone to the flashlight beam. I want the cone to have some sort of material or any other method that makes my dust particles only appear within the beam with a opacity falloff to make it smooth. How would I begin to do this?


Hey there @ADHDeveloper! So there’s not really a “simple” way to go about this. The half measure would be to use lit particles in a dark environment. They will always be brighter and more visible in light naturally due to their lit nature.

However if you want more control, like only being visible in your flashlight cone, you may need to get into Niagara Scratch Pad and HLSL. This allows much more fine grain control, however it’s also quite complex.

Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.

1 Like

Thank you I’ll dive into what you’ve shown me. For the method of them only spawning in the dark how would I go about this as well?

I’m really going for this look here
YouTube Reference

Hi, my knowledge of working with materials is very limited, but the SphereMask node, connected to opacity, will do exactly what you’re asking, with the exception of the fact that it is a sphere instead of a cone. To my knowledge there is no “ConeMask,” but I could imagine you could maybe combine a few spheremasks of increasing size? Perhaps a better way exists; there are some other “mask” nodes but SphereMask is the only one I’ve personally used.

Here is how I have it set up in my project:

As SupportiveEntity says, it may be easier to simply spawn the particles in the room and allow the lighting itself to highlight them normally.

2 Likes

Ahhhh okay, thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.