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
- Crash on PluginManager::RefreshPlugins when closing the Editor without making any changes with JetBrains Rider selected as the External Code Editor and Google Mobile Ads third-party plugin imported
- GetMainLight() returns incorrect distanceAttenuation value for a Custom Shader when URP Forward+ Rendering Path is used
- Standalone Profiler crash on GuidReservations::Reserve when it is opened on a specific project
- m_RenderPipelineGlobalSettingsMap or m_SRPDefaultSettings is pointing to UnityEngine.Rendering.HighDefinition.HDRenderPipeline when High Definition RP package is removed
- Rendering Debugger fields have no padding at the bottom of the fields list
Add comment