- Home /
World object in front of GUI object
Hi! I want to spawn a Particle System in front of a GUI Texture. Is this possible somehow? Because until now the particle system is not visible in the area where the GUI Texture is. I want the particle system to spawn "in Front" of the GUI item.
Answer by Moohasha · Sep 20, 2013 at 01:38 PM
GUI elements are drawn using a different transform matrix so that they are always in screen space, not world space. They are also drawn after the scene if I'm not mistaken. I don't think what you are trying to do is possible unless you can add a particle system to the GUI, which I don't know how to do.
The answer is correct.
You could try to make your menu in 3D space so you can use Particle Systems. Alternatively you could try to fake a particle system using clever animation and/or sprites.
Answer by Eric5h5 · Sep 20, 2013 at 03:50 PM
If you're talking about GUITexture objects, then yes, though you need two cameras. (There are questions/answers which explain this; do a search.) If you're talking about OnGUI code, then no.
Answer by clunk47 · Sep 20, 2013 at 04:25 PM
Try looking into http://docs.unity3d.com/Documentation/ScriptReference/Camera.ScreenToWorldPoint.html