Search Issue Tracker
By Design
Votes
2
Found in
2018.3
2019.1.0a1
2019.1.5f1
2019.2.0a1
2019.3.0a1
Issue ID
1161502
Regression
No
Changing the position of a RectTransform twice doesn't work when it is instantiated in the same frame
How to reproduce:
1. Open the attached 'UIBugRepro.zip' project
2. Enter Play Mode
3. Observe created 'UI(Clone)' Game Objects
Expected result: Both cubes get covered by the UI elements
Actual result: Only one of the UI elements does work properly
Reproducible: 2018.4.2f1, 2019.1.6f1, 2019.2.0b6, 2019.3.0a6
Can't reproduce: 2017.4.29f1, 2019.3.0a1, because of 'MissingReferenceException: The variable _uiTemplate of BugRepro doesn't exist anymore.' errors
Notes:
- Workaround: Delete 'ui2.position = new Vector3();' (at Assets/BugRepro.cs:19)
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
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
Resolution Note (2019.3.X):
The user is changing the canvas position which is a driven position. When the calculations are done for where the pivot should be it is using a invalid starting position as the the Canvas will then reposition itself so it lines up where the rendering is expected.
It is also not good practice to use .position on a rectTransform as its not tracked and it can cause issue with the final calculated position. anchorPosition should be used instead as thats a tracked position.