Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

ConvertToEntity causes GameObject Character to t-pose and resize

Discussion in 'Entity Component System' started by renehupfer, May 24, 2022.

  1. renehupfer

    renehupfer

    Joined:
    May 5, 2017
    Posts:
    3
    As the title says when I convert the character it gets resized to about 100 times the intended size.
    I have not found anything on the topic - is it a known issue at all?
    I will supply more info if needed, just don't know what is needed. There are no compile errors either. This only shows in play mode, too (after conversion).

    The model always worked great and was created in blender and imported as .fbx
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,592
    Bones scaling is probably incorrect.
    You need provide more information.
    Which unity, packages, etc.
     
    MNNoxMortem likes this.
  3. renehupfer

    renehupfer

    Joined:
    May 5, 2017
    Posts:
    3
    Usually don't seek help online, sorry. Is a no brainer to provide those infos at least.
    The rig parent object got a scale of 100xyz and a rotation of -90 on the x. All child bones have a scale of 1xyz.
    Next to the rig is the mesh object with scale 1 and skinned mesh renderer.
    They both share a parent on which the ConvertToEntity script sits.

    Unity 2020.3.30f1, DOTS (Hybrid Renderer) 0.50 Prev. 44, DOTSNET, DOTS editor, Entities 0.50.1 Prev. 2
    The issue persists in another project file with just DOTS itself, as well.
     
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,592
    There was in problem in past, floating in the forum somewhere, regarding doubling distance of bones.
    Are you using Unity Animation by any chance? Not sure if it works with DOTS 0.50?

    Rotation has common problem with -90 in Unity, if model fbx comes from blender.
    Unity Engine normally handles that.
    However if you have some custom code for animations using DOTS entities, or bones handling, maybe these are the problem?
    Do you use by any chance custom code for handling bones?
     
  5. renehupfer

    renehupfer

    Joined:
    May 5, 2017
    Posts:
    3
    So it seems that the rig scale of 100xyz is the issue. When set to 1xyz it disappears in Scene view, but in play mode (after entity conversion) now shows the correct size.
    Maybe the bone positions are all wrong and relying on the scale being set to 100, which the convert script doesn't like.
    I don't use Unity Animation.
     
  6. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    3,993
    I would have to see your prefab hierarchy to know what is going on, but I can at least provide some insight into what the Hybrid Renderer conversion code does.

    It forces RenderMesh conversion as if there were multiple materials. So it creates a new RenderMesh entity for each material, even if there is only one material on the SkinnedMeshRenderer. It takes the root bone of the SkinnedMeshRenderer, and parents the created entities to it. Then it sets the created entities LocalToParent to identity, effectively making them copy the world transform of the root bone entity.

    If your SkinnedMeshRenderer has a non-identity transform, that usually means you messed something up between your DCC and Unity. GO workflow is pretty robust against this. DOTS is not very robust. My custom solution is somewhere in the middle.