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
- After converting a Built-in project to URP render texture related errors are spammed that can lead to Game view being rendered on top of Scene view
- UI Builder slider value lags and stutters when sliding/modifying certain property values
- "Reset UI Builder Layout" functionality inconsistently changes Canva Size when "Match Game View" is enabled/disabled
- Texture Import Warnings are obscured by other Terrain Layer options in the Inspector
- Burst Inspector middle divider is jittering when resized with the Burst Inspector window docked
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