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
- Additional empty space becomes visible under "Scripts" in the "Add Component" window
- Longer component titles overlap navigation arrow in the "Add Component" window
- Joint Physics result in unexpected behaviors when used for articulated vehicles like buses or trucks
- Standalone Player crashes with "TDerived GetOrLoad<TDerived>() where TDerived : T" when IL2CPP Code generation is set to "Faster (smaller) Builds"
- IndexOutOfRangeException and InvalidOperationException when logging XML string
Add comment