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
- Console displays "ArgumentException: Cannot unschedule unknown scheduled function UnityEngine..." error after the "Audio Random Container" closing
- [Ubuntu] Asset Bundles Dropdowns Contain Empty Row in Inspector
- Symbols are generated for a third-party native plug-in with 'Shared Library Type' set to 'Executable' when building for Android
- "Search by Import Log Type" Icon Nearly Invisible in Light Theme (Project Window)
- [Android] Realtime Directional Light turns off when there is no realtime shadow caster in the view
Add comment