It is rendering in front of all elements of UI canvas, but the problem is I want it to render just behind the button and in front of other elements. I have tried every solution available online but I’m unable to achieve this.
Also I want to render lights in UI Canvas to get some effects without using URP or any other package.
First, verify your Canvas component’s Render Mode is set toScreenSpace-Camera If it is rendering in World Space it may pick up the particles. If rendering in World Space is necessary for your game, then try the next step.
Second, play around with your sorting layers. The Particle System component has a property for sorting layer and sorting order. The Canvas component should have the same properties. Ensure the Particle System is on a lower sorting layer than your Canvas and/or on a lower sorting order number (e.g set Canvas Sorting order = 1, Particle System Sorting order = 0).
To have it render in front of some elements and not others, you may need to use multiple Canvas objects with different layers based on how they should render relative to the particles.