Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved PhysicsBody on GameObject prefab: error when creating Entity

Discussion in 'Physics for ECS' started by EternalAmbiguity, Feb 7, 2022.

  1. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    I have a GameObject prefab that I first convert to an Entity with
    StaticClass.entityPlayer = GameObjectConversionUtility.ConvertGameObjectHierarchy(prefabPlayer, settings);
    and then instantiate with
    StaticClass.entityPlayer = em.Instantiate(StaticClass.entityPlayer);
    . The latter causes an error:
    pb_yes.png
    However when I remove the PhysicsBody component from my prefab it goes away:
    pb_no.png

    I've tried messing with the PhysicsBody component settings but none of them remove the error. I've also tried adding it in code (
    em.AddComponent<PhysicsVelocity>(StaticClass.entityPlayer);
    ) and it does the same thing. I'm using 0.6.0-preview.3 for com.unity.physics and no later version is shown.

    I'm using 0.15.0-preview.21 for com.unity.collections, and updating to 1.1.0 causes an error in Jobs, and updating that (from 0.8.0-preview.23 to 0.11.0-preview.6 or preview.5) causes over 100 errors in Entities (0.17.0-preview.42)...so I'm on 0.15.0-preview.21 for com.unity.collections.

    Does anyone have a clue why this could be happening and/or how I fix it?
     
  2. TRS6123

    TRS6123

    Joined:
    May 16, 2015
    Posts:
    246
  3. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    That worked, appreciate the link.