- Home /
Worldspace UI in wrong position/scale after scene change
Hi, just had an strange issue happening to my UI, but only happens in builds. Basically I have this group of worldspace canvases in a small square area, set to be my title screen(VR). the canvases are suspended in the air as if they were billboards. One is an actual Menu with options, but the rest are only some labels and images with credits information or logos. Now I've set them up so they reach the player around the chest height (not dynamically, just manually set their height). And it works perfectly in the editor, but in the build all of the canvases start much, much lower than in the editor's playmode, so the player has to bend down to reach the menu. The canvases are stored on an empty object with a zeroed transform. I tried checking the default resolution, tried moving the whole empty way, way higher, but same thing happens, they end up near the floor, I even disabled the canvas scaler in the canvases to check if it was a resolution issue, but it keeps happening, and only in the builds. I don't know if VR has anything to do with it (Using SteamVR/VRTK).
There are other scenes where I'm dynamically controlling the UI's position, for like an inventory menu and or hotspot titles or other text, and the position works pretty much like it should with those.
I do have noticed one more issue, though, and it's that one of the canvases, which is there only to display text, gets huge every odd play session (basically one session is the right size, but if you close and reopen then it goes huge, and so on). I'm not too sure about this issue cause I do have some code which allows resizing the UI for some objects but I'm pretty sure I'm scaling it back to it's original size afterwards (OnDisable), also the place where I use the rescaling is in the scene prior, and as I said, at times it works just right for the whole session, and I'm not saving the scale of the UI in player prefs or modifying the original prefab at all, so the scale shouldn't be remembered at all. But worst of all is that both issues only happen in the build, in the editor's play mode it works like a charm...
Has anyone ever had an issue like this? anyway, any advice would be highly appreciated.
PS: Ah, I also have absolutely no script error warnings in the development builds, but the UI issue is ever present, it just doesn't get registered as an error at all...
Edit: I managed to reproduce the error in the editor. It seems to happen whenever I scene change and the UI is placed manually in the scene. I keep the rest of my UI in prefabs which are instantiated per scene so I had never noticed it before.
Your answer
Follow this Question
Related Questions
World Space UI Scale To Fit Screen At DIfferent Aspect Ratios 1 Answer
Coincide Input.mousePosition with UI element position to be on same coordinate system 0 Answers
Image with material is not render 0 Answers
PlayerPrefs issue 2 Answers
Strange UI Button hover offset when using Worldspace Canvas in VR 4 Answers