I’m working on a 2D game with Unity 4.6 beta, and I’m using the new UI elements to make some buttons on a GUI overlay on screen. Whenever I instantiate a prefab (with a sprite) from code, however, the sprite is rendered on top of the UI elements. Why is that, and how can I change this behavior?
I’ve tried setting the layer of the prefabs and also through code on run-time to set it to a user defined layer, but it didn’t work. Am I doing something wrong?