Search Issue Tracker
Won't Fix
Votes
0
Found in
2021.3.36f1
2022.3.22f1
2023.2.15f1
6000.0.0b13
Issue ID
UUM-67753
Regression
No
Optimise gameobject breaks skinned mesh when the root bone is changed
Reproduction steps:
1. Open the attached “Repro“ project
2. Open the “Assets/OutdoorsScene.unity“ Scene
3. Enter the Play Mode
4. Observe the Game View
Expected result: The Pink and White meshes move in the same way
Actual result: The Pink meshes have a pivot offset, and are not in the correct position
Reproducible with: 2021.3.36f1, 2022.3.16f1, 2023.2.15f1, 6000.0.0b13
Reproducible on: M1 MacOS 14.3.1
Not reproducible on: No other environment tested
Work Around
The issue does not reproduce if the root bone field is left to the default. A work around would be to have the importer select the desired root bone by default. The default root bone is picked out of the list of assigned bones to the SkinnedMeshRenderer. With the current (default) settings only bones that are referenced by skin influences are assigned to SkinnedMeshRenderer. In the case of this mesh for example this does not leave good candidates. There are two options to include the desired bone into the bones list during import:
option 1: Add a triangle that is skinned to the desired root bone in each mesh (or skin an existing vertex in each mesh with a small influence to the desired root bone). The root bone will then have a non-zero influence and will be included in the bones array.
option 2: (not recommended) Disable "Strip Bones" option on the importer. This will assign all transforms as bones to the SkinnedMeshRenderer. This option might have a larger performance impact as it could assign many more bones to SkinnedMeshRenderer.
In both cases, the changes in bones can be monitored through SkinnedMeshRenderer.bones. Once the desired bone is included in the bones array it will be selected as the root bone because it is the 'most' common ancestor.
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
- Warnings in the Bug Reporter window are cut off and not truncated when the Bug Reporter window is resized to its minimum size
- Color is incorrectly applied to objects when initialized with non-normalized parameters
- SerializationUtility.GetManagedReferencesWithMissingTypes() don't return null when “Prefab has missing SerializeReference Types“ warning banner is present
- Memory leak when VFX Graph is open and Camera has "Target Texture" enabled
- The Canvas component's warning box is missing an apostrophe when Additional Shader Channels is set to "Normal" and "Tangent" with Render Mode set to "Screen Space - Overlay"
Resolution Note:
The implementation of "Optimise GameObjects" does not account for changes to the root bone field in SkinnedMeshRenderer. The system locks into the root bone that was selected at import time. Modifying this behavior will entail significant changes that can impact the broader area and regress other behaviors. This is due to how information for this feature is stored today. After import not enough information is available to handle a root bone change. Furthermore, the way the information is stored won't allow for per-instance (prefab/game-object) changes. Please make use of the work arounds mentioned below.
_Work Around_
The issue does not reproduce if the root bone field is left to the default. A work around would be to have the importer select the desired root bone by default. The default root bone is picked out of the list of assigned bones to the SkinnedMeshRenderer. With the current (default) settings only bones that are referenced by skin influences are assigned to SkinnedMeshRenderer. In the case of this mesh for example this does not leave good candidates. There are two options to include the desired bone into the bones list during import:
- option 1: Add a triangle that is skinned to the desired root bone in each mesh (or skin an existing vertex in each mesh with a small influence to the desired root bone). The root bone will then have a non-zero influence and will be included in the bones array.
- option 2: (not recommended) Disable "Strip Bones" option on the importer. This will assign all transforms as bones to the SkinnedMeshRenderer. This option might have a larger performance impact as it could assign many more bones to SkinnedMeshRenderer.
In both cases, the changes in bones can be monitored through SkinnedMeshRenderer.bones. Once the desired bone is included in the bones array it will be selected as the root bone because it is the 'most' common ancestor.