- Home /
How to move UI Image under the other UI elements?
Hello, I tried these options but it does not work maybe I'm doing it wrong (I am for sure).
AWPScope.transform.SetAsLastSibling;
AWPScope.rectTransform.transform.SetAsLastSibling;
Please help I want AWPScope to go to the bottom so the player will be able to see points, ammo etc. How to do it?
What do you mean by "move UI Image to the bottom"? You want to place the UI at the bottom of the screen?
The functions you have provided change the order of the gameObject in the hierarchy in order to draw it after all its siblings.
I want other UI elements to be above it. You know the layers in GI$$anonymous$$P or other graphics editing softwares. I want to move it under the other elements so that the other elements can be visible.
Answer by Vega4Life · Dec 25, 2018 at 08:51 PM
If you want AWPScope to be underneath your other elements, it needs to be first in the hierarchy - not last.
AWPScope.transform.SetSiblingIndex(0);
The above code will - then it will draw first. This only assumes the things you want to draw on top of it is under the same parent. If it isn't, the now we have to make sure AWPScopes parent is higher in the hierarchy than the parent of the things you want to be on top. - Higher things draw first, which means later things draw on top of.
Answer by ZachVille · Dec 24, 2018 at 07:54 PM
The way to fix this is to set a negative z value on the position of the rectTransform.
rectTransform? But the AWPScope is Image not rectTransform...
Your answer
Follow this Question
Related Questions
How to fine-control UI elements scale 0 Answers
Image on UI doesn't stretch when objects it's on is stretched. 0 Answers
Get Image from another scene 2 Answers
UI Masking (Type visiblity of the content outside and inside of mask ) 0 Answers
UI image with button component not tracking mouse correctly 1 Answer