Search Issue Tracker
By Design
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
- Scene view audio toggle doesn't work after disabling and enabling audio source component with audio random container
- Pitch changes while paused messes up scheduling of the audio random container
- Crash on detail::ComputeShaderSnippetKey when entering the Play mode
- Unable to interact with Material Inspector window when creating a new Material and renaming it
- Shadow artifact is cast onto GameObjects in the Scene view when the Scene view lighting is disabled
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