Child not following parent in UI animation?
Hi, I am having trouble with UI positioning. First, I added a button to the panel under the canvas, and when it set it to the desired position in the editor view, it is below where I need it to be in the game view. I set it to be in the right area in the game view, but it makes working on it a pain.
The second (and I'm sure related) issue is that I have the button as a child of an image that animates into the game view. As in, it is off camera, and when I trigger the animation, the image slides into view. That works fine, but I want the button to maintain relative position to the image, like a child should. Instead, it does move, but only about halfway. Why wouldn't it be maintaining relative position to its parent object?
I feel like this has to do with anchoring, but I can't for the life of me figure it out. If anyone could help, it would be much appreciated. Please let me know if you need more info.
Thanks
hello can you share screen shots? it is hard to imagine what is happening
Here are some screenshots. The first one is in editor, where it says Log In, right on the bar. In game view, it is lower and slightly to the right. Finally, when I have activated animation, it moves, but not as much as I want it to. I want it to move just as far as the parent image (login menu scroll). Sorry they are low-rez:
Answer by cstobler · Feb 15, 2019 at 07:38 PM
I was testing today and decided to just delete the old button and totally start from scratch. Now it works. I should have tried this earlier, but I just assumed that a simple button with almost entirely default settings wouldn't be this bugged. I think the Unity UI system is more bugged than I thought. Anyway, moral of the story is, if you are having an issue with the UI system that doesn't make any sense, try a new one from scratch and see if it works.
Your answer
Follow this Question
Related Questions
Problems with Canvas and ui elements scaling at runtime 0 Answers
Updated with UI text element not correct (same frame) 0 Answers
Possible for 10 canvas in 1 scene? 1 Answer
Dark UI canvas isssue 0 Answers