Search Unity

Physics entities hide transforms from the inspector

Discussion in 'DOTS Physics' started by Antypodish, Sep 7, 2019.

  1. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    9,039
    Any reason, why new physics system, hides all transforms from the inspector?

    upload_2019-9-7_19-16-51.png

    But I can not see Position(Translation)/Rotation. However I can change them via system.

    I use as base, CreateBody method from BasePhysicsDemo.cs, form physics samples, to create colliders.
    Note, I have added own ColliderIndex.

    Code (CSharp):
    1. Entity entity = entityManager.CreateEntity( new ComponentType[] { } );
    2.  
    3. entityManager.AddComponentData ( entity, new LocalToWorld { });
    4. entityManager.AddComponentData ( entity, new Translation { Value = position }) ;
    5. entityManager.AddComponentData ( entity, new Rotation { Value = orientation }) ;
    6. entityManager.AddComponentData ( entity, new ColliderIndex { i = colliderIndex }) ;
    7. ....
    8.  

    On side note, what is best/correct way, to get collider index of entity? Currently I assign manually, as the are created. I also create enteritis references with HashMap, to access correct entity.
     
    Last edited: Sep 7, 2019
unityunity