Having constant trouble with Unity's inbuilt UI system.
Hello,
I have a big problem I have had for a long time with unity's inbuilt UI system. I have never used it in any of my games as it has never worked properly, it often likes to rearrange itself and do strange unexpected things when I return from game. Also the newest problem I have, (because I need to use it for a clients job) is that I set it all up according to the manual and all, I have a base canvas and canvas group, then under that I have a unity pre-made text input field which I have removed the canvas part, as I already have it on a higher canvas object in the hierachy, and the rest of the text input field should be right.
It all appears right in the editor and in the game window, until I hit play, as I hit play, it vanishes from the game view and once switched to full screen game view (the automatic way) its not in the game, its vanished. I have had problems with unity UI ever since I have been using unity for the last 5 or more years and have never been able to successfully use it, as it does all strange things and has not been fixed, either that or am I totally missing something here?
Could someone please explain why sometimes when coming out of play mode, the ui has recentered itself or changed all of its positions to something that seems random.. And why everything just vanishes when I run it.
Answer by Stefan02 · Jun 20, 2016 at 08:05 AM
Do you have set UI Scale Mode to Scale with Screen Size???!
Yeah I looked at that but doesn't that just put the ui onto the camera? I'd like to have it on objects so they can move with the object. I have a user agreement and email object and I need input text boxes for it. Only thing when I use world space and use the sorting order, it does not work.
All UI you use in game must be in Canvas gameobject, not on objects you want You have to programme them so they follow the objects OR Put that objects in Canvas and then UI
Your right you know, I should have known that, I did it like that a long time ago for an old project, I put all the objects under the canvas and it all worked, but had a habit of re-centering all of the objects I put in it into the middle of the screen when I play. So I kinda got tired of re-positioning everything. Don't know why it was doing that either.
I'll try and see if I can get it to work. Thanks for your help. I'll let you know if I get it.
So what? I have to have it on Screen space camera? Can't use world space and have more control? So I have to somehow displace the camera or something to make it move? How can I make it scroll if it is dynamically updating to the cameras view?
Does not work. No matter what I do or how I set it up it vanishes when I press play. I've set parent object up as canvas and child image as a background ui image and it vanishes too. No matter what I do, and how I set stuff up, it either isn't right, or isn't right sorting order, or once I have it right (at least what I think is right), it vanishes when I press play. Often It vanishes just in the editor looking at game view. Never have I ever been able to use ui without weird things going on. I use my own custom things ins$$anonymous$$d to get around it.
If you can help me sort this, send me a paypal.payme link and I will donate to you, I really need to get this sorted.
This is what I want, It does not work lol. It never has.
World Space
In this render mode, the Canvas will behave as any other object in the scene. The size of the Canvas can be set manually using its Rect Transform, and UI elements will render in front of or behind other objects in the scene based on 3D placement. This is useful for UIs that are meant to be a part of the world. This is also known as a “diegetic interface”.
I can't get it to do what they claim it does hahaha! Its probably me (the operator), it might not be? I need help.
Answer by Kastenessen · Jun 20, 2016 at 08:32 AM
What you say works for one thing, what I want is another thing that it is supposed to be able to do, but it does not work. I want it to be in world space so I can have it on objects, and it does not work. It vanishes upon pressing play.
Seems to be bug with unity?? $$anonymous$$aybe?? $$anonymous$$aybe its the operator? You'd think after trying for so long I'd have a solution, just from playing around with settings at least. But no alas, it does not seem to want to worky.