Is this possible? Even if I have the game object in a top layer, the UI still shows on top.
UI Toolkit only supports the “overlay mode” at this time, which is always rendered after the cameras (regardless of the GameObjects order in the hierarchy, as you noticed).
However, you can assign a target RenderTexture to your PanelSetting asset, so that the UI will be rendered in that texture. Then, you can apply that texture to a plane/quad in world space, which will honor the hierarchy order.
We have plans for “world mode” support in the future, which would allow you to order the UI in the scene without requiring a RenderTexture.
I assume in this case we’d have to handle our own raycasting interactions? i.e. cast a ray, and send the coords into UI toolkit?
Yes. There’s documentation and an example provided in the SetScreenToPanelSpaceFunction() docs:
https://docs.unity3d.com/Packages/com.unity.ui@1.0/api/UnityEngine.UIElements.PanelSettings.html#UnityEngine_UIElements_PanelSettings_SetScreenToPanelSpaceFunction_System_Func_UnityEngine_Vector2_UnityEngine_Vector2__
If I have a button on an element displayed in this way, what would be a sensible way to have the :hover pseudo element applied when the mouse cursor is over the button? It seems the SetScreenToPanelSpaceFunction
is only called when the mouse button is down.
I got it working here, make sure the Unity + GameView have the focus. Might be worth trying in a player as well, just to make sure.
Is there any update on being able to “world mode” support or being able to show game objects on top of the UI or between 2 UI elements?
This is still in development, we cannot provide an ETA at the moment.
Gotta be honest here, has Unity ever actually finished anything? I’ve been working with Unity since 2017 and it seems like your teams just give up halfway through working on a new update or feature, and then years go by (in this case 3 years) with no updates. I remember signing up for Unity Connected Games, then you guys never finished it and just bought MLAPI and jammed it into Unity in a half-working-not-really kind of way. You did the same thing with Collab, you implemented a service that wasn’t all that great and then bought Plastic SCM and just jammed it into the editor, and nobody really likes Plastic SCM at all either. It’s the same thing with UI Toolkit now, you wanted to change the way Unity did it so you did half of UI Toolkit, jammed it into the editor, and have essentially released no real updates to it in at least 18 months. I just don’t understand the business model, and it’s pretty frustrating as a professional developer to be working on an app that gets used by tens of thousands of people and you can’t really design a new version well because you have to assume all the new things Unity is talking about will never actually be implemented in a complete manner, so as a developer you have to wonder when you guys are going to abandon the project and if your teams will do enough before then that will make that feature usable in any real capacity / how much work will my team have to do creating and doing the things your team should have implemented.
Hi @EricRaboin ,
I understand your frustration about not having access to your expected capabilities. Even though world space UI has not been released yet, I think it’s unfair to say UI Toolkit has been abandoned with no updates in the last 18 months. If you’ve been following its development, you’ll notice many new features, quality-of-life updates, stabilization, and performance improvements. Documentation has received significant investment lately, adding many pages and samples.
Our goal of replacing UGUI and IMGUI with UI Toolkit remains our top priority, and doing so while maintaining existing systems adds significant overhead. We sincerely hope we could release everything sooner, and if we could we would.
Since things are this slow despite being “our top priority” at Unity, do you think you could get someone to do a run of optimisations of the old UGUI Canvas constraints and resolvers etc whilst we wait?
Maybe Burstify and Jobify them, see what that does for performance of more complex UI in world space, for now, for things like the Death Stranding and The Division, etc.
That’s a great point. This has been considered and we decided not to invest in those efforts to avoid slowing down our progress on UI Toolkit.
Is there any status updates on this? Not having the ability to render Game Objects “on-top” of UI Toolkit makes it much less desirable. Its amazing otherwise for building UI, I just wish it had this critical feature…
Same here. Having trouble to render Game Objects “on-top” of UI Toolkit. I do agree that this is something critical too. Has anyone come up with an easy way of achieving this? Can not make things work with suggestions I have found so far :(.
Here’s a tutorial that covers it for UGUI. To apply it to UITK just assign the render texture to the image of the visual element. The video is four minutes long but once you know what to do the actual process is less than a minute.