To create a World Space UI, set the render mode of the Panel Settings asset to World Space.
In a World Space UI, you can position, rotate, and scale UI elements just like any other 2D or 3D objectA 3D GameObject such as a cube, terrain or ragdoll. More info
See in Glossary. This is useful for displaying interactive UI elements, such as health bars or labels, directly in the game world, tied to objects or characters.
You need to decide what’s the resolution of the World Space UI. You set this in the Pixels Per Unit parameters of the Panel Settings asset. This is the number of panel-space pixels that fit into one unit in the World Space. The default value is 100
, which means that one unit in the World Space is 100
pixels in the panel. This is a good starting point, but you can adjust it to fit your needs.
To specify the size of the World Space UI container, use USS properties size
and position
. The container (UIDocument.rootVisualElement
) contains the UI Document and is the parent of all the elements in the UI hierarchy. The size
property sets the width and height of the container in World Space. This allows you to control how large the container appears relative to other objects in the SceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary. The position
property determines the container’s location in the World Space and lets you place it accurately within the 3D environment.
If you create your UI in absolute position with an explicit size in USS, in your UI Document’s Inspector window, select World-Space Dimensions > Size Mode > Dynamic. This ensures that the World Space UI adjusts itself to the content size. Otherwise, use the Fixed option and set the size manually.
If you connect multiple UI Documents to the same Panel Settings asset, you can configure each container’s size and position independently. In the following example, two UI Documents share the same Panel Settings asset, but each container has its own size and position settings, allowing flexible customization within the same World Space UI setup.
Tips:
Unlike a Screen Space Overlay, you can freely position and rotate a World Space UI within the Scene viewAn interactive view into the world you are creating. You use the Scene View to select and position scenery, characters, cameras, lights, and all other types of Game Object. More info
See in Glossary. You can place it on walls, floors, or ceilings. You can also position it on slanted surfaces or have it float in mid-air. Use the standard Translate and Rotate tools in the Scene view’s toolbarA row of buttons and basic controls at the top of the Unity Editor that allows you to interact with the Editor in various ways (e.g. scaling, translation). More info
See in Glossary to adjust the position and orientation of the GameObjectThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary that’s referencing your UI.
The pivot reference size is the size of the container that the UI Document uses to calculate for pivot positioning in World Space.
To set the pivot reference size, in the Inspector window of the UI Document, select the following pivot reference size from the World-Space Dimensions > Pivot Reference Size dropdown list:
The pivot point is the reference point the UI Document uses for position and transformations, such as rotation and scaling. The default pivot point is at the center of the UI Document. You can set it to any of the following points in the World-Space Dimensions > Pivot dropdown list in the Inspector window of the UI Document:
To configure the Panel Input Configuration settings, do one of the following:
This adds a Panel Input Configuration component. You can then configure the Panel Input Configuration properties in its Inspector window.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.