VisualElement.transform is deprecated in Unity 6.2: use style.translate
Unity 6.2 deprecated VisualElement.transform. Set position, rotation and scale through style.translate, style.rotate and style.scale, and read them from resolvedStyle.
- Status
- Obsolete since Unity 6.2 · UI Toolkit
- Old
VisualElement.transform- New
style.translate, style.rotate, style.scale- Checked
- 2026-10-05, against the sources below
What changed
UI Toolkit elements had a transform property for moving, rotating and scaling them from code. Unity 6.2 deprecated it in favour of the style properties, so code and USS now control transforms through the same system.
Write through style.translate, style.rotate and style.scale. Read the current values from resolvedStyle, which reflects USS and transitions as well as what your code set.
Before and after
Before
C#
panel.transform.position = new Vector3(0, -40, 0);
panel.transform.scale = Vector3.one * 1.1f; After
C#
panel.style.translate = new Translate(0, -40);
panel.style.scale = new Scale(Vector2.one * 1.1f);Find every place it appears
This change needs a hand edit, but the Unity 6 Script Upgrade Checker points to every line it affects, together with the other changes for your target version.
Open this example in the checkerQuestions
- Why does the value I read back differ from what I set?
- style holds what your code set; resolvedStyle holds the final value after USS rules and running transitions are applied. Read from resolvedStyle when you need what is actually on screen.
- Can I animate these with USS transitions?
- Yes. translate, rotate and scale are transitionable USS properties, so you can set them from code and let a transition in your stylesheet animate the change.