- Home /
How to put sprites on top of a Unity 4 button GUI
I have a map with buildings as the buttons. And the character will walk to a building if it is clicked (after the button finished its animation sequence that is). It seems like the canvas for GUI always get rendered on top of the scene no matter what (and all its GUIs). Is it possible to do this? If so, how do I do this?
Thanks, Bawenang
the GUI really does get rendered after everything else, IT was one of the reason why they deprecated it and started using UI which as many ways it can be rendered.
Did you try to move the sprite in front of the button??
@Fornoreason1000: I'm sorry, I haven't been pretty clear in my wordings. What I meant was the new GUI system (or UI?)where the whole UI will be put into a canvas, right? So, how do I put my sprite between 2 UIs in the canvas?
@JustAGuy: Didn't work.
Thanks for the comments though.
so you are using the new GUI (which everyone seems to call UI), theres a setting on the canvas component that allows you to change how it is rendered
Answer by bawenang · Jan 24, 2015 at 08:57 AM
Okay, I've managed to solve this myself. I turns out we can make multiple canvases. So I make 2 canvases. 1 Overlay, and the other with Screen Space Camera. And then, I put the Camera one in the lower sorting layer than the sprite. Thanks anyway guys. :)
Your answer
Follow this Question
Related Questions
Multiple canvases and graphic raycasters 1 Answer
How to Convert each 2D Array to GameObject 2 Answers
Store/Stack Items 0 Answers
How to change 2D x direction on button press and keep velocity 1 Answer