Search Issue Tracker
Won't Fix
Votes
0
Found in
4.6.0b2
Issue ID
592210
Regression
No
RectTransform.position.Set does not work
To reproduce:
1. Open "New Unity Project 52"
2. Open scene test
3. Enter play mode
4. Notice that the position of the button does not change even though a script is setting it to 0,0 every update
Explanation:
This is not a uGUI issue, it's a C# issue. When you call .Set on a Vector2/3 property, you are not setting the property but the value copy of the property. This is any property on any type.
http://answers.unity3d.com/questions/225729/gameobject-positionset-not-working.html
gameObject.position gives you a copy of the position. Calling Set then changes that copy and doesn't affect the property it came from. This is why in C# you typically assign a structure like Vector2/3 like this: "blah.property = new Vector3(0,0,0);"
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Documentation] useAPKExpansionFiles 2022.3 and 2021.3 documentation descriptions does not match same text of the splitApplicationBinary documentation in 6000.0
- Unable to navigate in the Scene when the Readme.cs script of an Asset exists in the project
- Directional Lights impact Sprites they should not impact when the GameObjects are on different Rendering Layers
- Custom Scene view Context Menu does not bypass the ordinary Context Menu shortcut
- Style Sheets cannot be referenced in a Theme Style Sheet file when the folder that contains the Style Sheet has a pound ("#") symbol in it's name
Add comment