I have been scouring the internet looking for a solution, and I can’t find anything. I have a particle system that I am using to emulate dust in the environment, and I need to play a video in our game, but I still want the dust to show (particle system). How would I go about showing a particle system (or sprites in general for that matter) in front of a video player (assuming you are using target camera)?
The only thing I have been able to think of is to use a render texture on a quad, but that makes it awkward in 2D. Any suggestions would be appreciated.
Is your video player attached to a game object in world space?
The video player uses MainTex and will automatically assign a texture.
This means that you should be able to access that GameObjects order in layer. Default, it will be 0.
I believe you should be able to access the particle systems order in layer and increment it by +1 and the effect should become visible.
If you’re not using world space then you are using screen space and the video player is always going to overlay world space. This is the nature of UI elements.
Well, I am not sure. I have it attached to a gameobject in the scene that is a sprite in world space. But the video player sets the main camera as its target camera. I thought that it just rendered the video directly to the camera. So I need to look into MainTex and see if there is a way I can utilize that so that I can overlay the particle system
I found a video for you for attaching your video player to a quad. I think you should be able to overlay particles over the quad. I’ve never tried this but do lemme know if it works.
Thanks for your help! I was able to switch the render mode to Material override (which is the default setting), and with a few minor adjustments to my code, it is now working! Honestly, that is what worked best for me, but for those reading this, if you are creating a normal 2D or 3D game (unlike my pre-rendered game), created a quad like in the video above is most likely the optimal solution if rendering directly to the camera is not achievable.