Search Issue Tracker
By Design
Votes
0
Found in
6000.0.59f1
6000.2.8f1
6000.3.0b6
6000.4.0a3
Issue ID
UUM-122358
Regression
No
[UI Toolkit] Missing documentation about RegisterValueChangedCallback being fired on entering Play Mode for Values using SerializedObject data binding
Steps to reproduce:
- Open the attached project
- Open the TestScene
- Observe the Game view: in-game UI displays a text field with a value "test", which is bound to the BasicSO scriptable object
- Select the BasicSO object in the Project view and verify that the values match
- Enter Play Mode
- Observe the Console window
Actual results: Despite no visual changes occurring, ValueChangedCallback is triggered. This behaviour is not documented
Expected results: Data binding sections mention ValueChangedCallback being triggered on entering Play Mode when using Two-Way or To-Target bindings
Reproducible with versions: 6000.0.59f1, 6000.2.8f1, 6000.3.0b6, 6000.4.0a3
Tested on (OS): macOS 26.0.1
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Editor crash on "PPtr<Shader>::operator Shader*() const" when checking in changes with a very long comment in Unity Version Control window
- [Ubuntu] Toolbar and menu items for Version Control lack spaces in text on Linux
- Unity Version Control window Pending Changes tab’s Item checkbox is unresponsive when clicked and the item list is empty
- Audio stuttering occurs when heavy processing is performed while OnAudioFilterRead is in use
- Inconsistent Node search results in VFX Graph
Resolution Note:
When entering play mode, the UI will be regenerated. Since the target TextField in the UXML file did not set a value, it will use the default one, which is an empty string.
When the binding is applied, it will set the value coming from the data source and if it is different, it will fire the value changed callback. This is all expected.
So although there might not be a visual change occurring, a change has indeed occurred.
As a side note, OnEnable/OnDisable should be prioritized to query elements and perform configuration. This is because the UIDocument will generate the UI on OnEnable and release it on OnDisable.