Search Unity

Question Avatar's Child Skinned Meshes are improperly converted during authoring/conversion?

Discussion in 'Graphics for ECS' started by HeavensSword, May 20, 2021.

  1. HeavensSword

    HeavensSword

    Joined:
    Jun 11, 2015
    Posts:
    20
    Hello,

    We are currently trying to transition an existing project over to Unity DOTS for the sake of performance.

    I have an Avatar prefab that I am attempting to convert into an Entity. Things seem to be converted for the most part, but the avatar has child meshes that are "exploded" out after conversion.

    Screen Shot 2021-05-14 at 4.37.43 PM.png

    Here's a shot of the prefab, note that the skinned mesh renderers are included as children of the Parent object while the Animator is on the Parent:

    Screen Shot 2021-05-18 at 2.14.09 PM.png

    I also have the "ConvertToEntity" script (Convert And Destroy) and my own AI Agent Authoring conversion script attached.
    All my conversion script does is add a Tag and AnimState Component.

    I use an Authoring Spawner to DeclareReferencedPrefabs (using the prefab shown in the image above).

    I thought that maybe if I initialized the Animator to something it may fix it, but that doesn't seem to be the case.

    The Animator is added using AddHybridComponent and then updated in a System where currently I just always set it to an Idle animation for now.

    Code (CSharp):
    1. [UpdateInGroup( typeof( PostSimulationSystemGroup ) )]
    2.     public sealed class AnimatorRefSystem : SystemBase
    3.     {
    4.         protected override void OnUpdate()
    5.         {
    6.             Entities.WithoutBurst()
    7.             .ForEach( ( Animator animator, in AvatarAnimState animState ) =>
    8.             {
    9.                 animator.SetBool( "OnGround", true );
    10.                 animator.SetBool( "StandingIdle", true );
    11.             } ).Run();
    12.         }
    13.     }
    At this point I'm wondering if it's just an issue with how our Avatar's are formatted; is it fine to have multiple SkinnedMeshRenderers arranged like this? Will ConvertToEntity handle this situation correctly?
    Using Convert And Inject will have the Avatar created correctly, but obviously that is because it's simply injecting a typical GameObject as well correct?

    I will note that we are currently using Unity 2021.1.7f1. I came across the sticky post about staying on 2020.3 and I plan to give that a try. I was just curious if anyone has run into a similar situation though.

    UPDATE: I've created a copy of the project on 2020.3.8 and am still seeing this issue.

    Thanks.
     
    Last edited: May 20, 2021