I'm developing a game with Unity3D. I found that particle effects would penetrate upper hierarchy UI. Can I show the effect when the UI's sibling index bigger then effect's and hide the effect when the UI's sibling index smaller then effect's?
-
\$\begingroup\$ Can you please share some more information because currently you question not clear may be image or you could define what does "UI's sibling index" means also how many particles systems are there. and please also explain a little more. \$\endgroup\$– SwatiSep 2, 2019 at 4:11
-
\$\begingroup\$ @Swati Ok.Suppose there are some game objects which have same parent object in hierarchy window.The top one's sibling index is 1, and the second is 2, the third is 3 and so on.You can realize it as upper or lower in hierawchy.I'm sorry for my poor english...Hope you can understand what i said. \$\endgroup\$– Winson SongSep 2, 2019 at 6:22
-
\$\begingroup\$ Ok. i got what do you mean from sibling ui indexes but i am sorry i steel confused about your question can you make a small video clip which will show the particles system and game hierarchy. \$\endgroup\$– SwatiSep 2, 2019 at 6:36
-
\$\begingroup\$ @Swati problem_picture ,the light edge effect on the brown block is my particle effect,you can see that the effect penetrated the drop down list though the drop down list was lower then the effect in hierawchy.But the result what i want is the drop down list would cover the particle effect.Have any solution to solve it? \$\endgroup\$– Winson SongSep 2, 2019 at 7:11
-
\$\begingroup\$ @Swati this is the glow(3)'s particle system \$\endgroup\$– Winson SongSep 2, 2019 at 7:17
1 Answer
To achieve this sort of effect:
You might have did it already as you are using particles but still to ensure you change the canvas "render mode".
- Now Change "Order in layer" to 0 for particles system.
- Add a component "Canvas" to the UI which you want to show up on the particles. In your case add "Canavs" to "drop_down_list_root".
- Now check the "Overriding sorting" and change "Order in layer" to some thing higher then particle's "Order layer" like:
And that's it. I hope this will resolve the issue you have.