- Home /
UGUI Basic Layout Questions
I'm using the Unity 4.6 beta right now trying to take advantage of the UGUI in there. I'm trying to add a button to an existing prefab but can't get the button to display where I want it to.
Here's what's happening.
When I add the button it appears in the center of the screen. I'm making it a child of the prefab but its positioning doesn't seem to be "in terms of" the prefab. I expected that if it was a child of the prefab it would be. Is this supposed to work this way? I'd like to be able to anchor it left or right and have it snap to the left or right of the prefab instead of the window.
Does anyone know how this works or if what I'm trying to do is possible?
Thanks!
Here's some screenshots for completeness
Answer by omatase · Sep 12, 2014 at 02:38 AM
Yay! I know how it works now.
I had to make the Canvas holding the button a child of my prefab and then make the canvas render mode "World Space". Then I made the canvas rect transform match the size and position of my prefab. Now whenever the prefab moves, the button moves with it.
Your answer

Follow this Question
Related Questions
How to get UI center position on UGUI? 2 Answers
Camera rotation around player while following. 6 Answers
Best way to move elements around screen [uGUI] 0 Answers
How Do I Drag And drop GUITextures From Set Positions? 1 Answer
Camera movement 1 Answer