Unity Issue Tracker - Incorrect UI document size and positioning of element in a worldspace UI document when 'align self' is set to 'center' on template
Closed
UUM-140851
Incorrect UI document size and positioning of element in a worldspace UI document when 'align self' is set to 'center' on template
Unity: UI Toolkit Framework
As Designed
6.6.X
6.5.X
6.4.X
6.3.X
6000.3.0a3 onwards
There is an option to change the size used to compute the PanelRenderer/UIDocument size. By using "Layout" instead of "Bounding Box", this should make the positioning more stable in your situation.
Reproduction steps:
Open the attached “IN-140449” project
Open the SampleScene
Enter Play Mode
Observe the “BoxCollider” Component on the “Worldspace UI” GameObject, note its size
Press the “Add Child” onscreen button
Press the “Set align-self: center” button
Observe the “BoxCollider”, compare its size to step 4
Actual result: The BoxCollider’s size increases from 4x3 to 4.15x3
Expected result: The BoxCollider’s size does not increase