Search Issue Tracker
By Design
By Design in 2023.1.X
Votes
0
Found in
2020.3.39f1
2021.3.9f1
2022.1.14f1
2022.2.0b6
2023.1.0a8
Issue ID
UUM-13005
Regression
No
Quaternions are initialized with the real part being zero
Reproduction steps:
- Open the “PoseTest” project
- Open the “SampleScene” scene
- Press the Play button
- Observe the Console
Expected result: “(0.00000, 0.00000, 0.00000, 1.00000)” is printed in the Console
Actual result: “(0.00000, 0.00000, 0.00000, 0.00000)” is printed in the Console
Reproducible with: 2020.3.39f1, 2021.3.9f1, 2022.1.14f1, 2022.2.0b6, 2023.1.0a8
Reproduced on: Windows 10
Note: one of the workarounds for the issue would be to set one of the rotation values in the Inspector and save the scene. This way the “W” parameter will be 1. It is also believed that 0,0,0,0 quaternion rotation is impossible or an invalid/undefined rotation.
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
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
Resolution Note:
This is by design in c# that fields in a struct are always zeroed by default. Thus, the quaternion will be (0,0,0,0) when the new struct is constructed an that is intended by the c# standard.
If you want to set default values to your quaternion, I recommend you add a `Reset` function to your MonoBehaviour. This is called whenever the component is created in the editor, or when manually clicking reset on the component sub-menu:
https://docs.unity3d.com/ScriptReference/MonoBehaviour.Reset.html
Resolution Note (2023.1.X):
This is by design in c# that fields in a struct are always zeroed by default. Thus, the quaternion will be (0,0,0,0) when the new struct is constructed an that is intended by the c# standard.
If you want to set default values to your quaternion, I recommend you add a `Reset` function to your MonoBehaviour. This is called whenever the component is created in the editor, or when manually clicking reset on the component sub-menu:
https://docs.unity3d.com/ScriptReference/MonoBehaviour.Reset.html