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. Dismiss Notice

Question Parent Component Disappearing (Debug Help or Work-Around)

Discussion in 'Entity Component System' started by fomartin, Aug 6, 2020.

  1. fomartin

    fomartin

    Joined:
    Aug 31, 2015
    Posts:
    17
    Hello!

    Been working on some Archery VR game using ECS to learn and practice. Added a ICollisionEventsJob to the ArrowCollisionSystem to detect collision of an Arrow with another collider.
    Code (CSharp):
    1. public void Execute(CollisionEvent collisionEvent)
    2.             {
    3.                 bool isEntityARotationFollowsLinearVelocity =
    4.                     RotationFollowsLinearVelocityGroup.Exists(collisionEvent.EntityA);
    5.                 bool isEntityBRotationFollowsLinearVelocity =
    6.                     RotationFollowsLinearVelocityGroup.Exists(collisionEvent.EntityB);
    7.  
    8.                 if (isEntityARotationFollowsLinearVelocity && isEntityBRotationFollowsLinearVelocity
    9.                     || !isEntityARotationFollowsLinearVelocity && !isEntityBRotationFollowsLinearVelocity)
    10.                 {
    11.                     return;
    12.                 }
    13.  
    14.                 Entity arrowEntity;
    15.                 if (isEntityARotationFollowsLinearVelocity)
    16.                 {
    17.                     arrowEntity = collisionEvent.EntityA;
    18.  
    19.                     RotationFollowsLinearVelocityGroup[arrowEntity] =
    20.                         new RotationFollowsLinearVelocityComponent() { IsActive = false };
    21.                 }
    22.                 else if (isEntityBRotationFollowsLinearVelocity)
    23.                 {
    24.                     arrowEntity = collisionEvent.EntityB;
    25.  
    26.                     RotationFollowsLinearVelocityGroup[arrowEntity] =
    27.                         new RotationFollowsLinearVelocityComponent() { IsActive = false };
    28.                 }
    29.                 else
    30.                 {
    31.                     return;
    32.                 }
    33.  
    34.                 Entity otherEntity = !isEntityARotationFollowsLinearVelocity
    35.                     ? collisionEvent.EntityA
    36.                     : collisionEvent.EntityB;
    37.  
    38.                 float3 collisionHeading =
    39.                     LocalToWorldGroup[arrowEntity].Position -
    40.                     LocalToWorldGroup[otherEntity].Position;
    41.  
    42.                 float angle = Float3Utility.Angle(
    43.                     collisionHeading,
    44.                     PhysicsVelocityGroup[arrowEntity].Linear);            
    45.  
    46.                 if (angle > 45f)
    47.                 {
    48.                     // TODO: Turn off all physics and reparent arrow
    49.                 }
    50.             }
    Collision is working, but I want to reparent my Arrow to whatever it hit such that it will follow that entity, whether it be a wall or eventually an enemy.

    That's where the problems arise. This is what I've tried so far:
    1. The Arrow entity doesn't have a Parent component because while flying through the air it shouldn't have a parent. So I decided to add a Parent component to the entity. Problem is that later on when setting the Parent component through using ComponentDataFromEntity<Parent> in it says that the Arrow entity doesn't have a Parent component. This is confirmed by the Entity Debugger.
    2. So I decided that maybe the Parent component will be removed if no data is given to the Parent so I decided to start doing some dumb tests; setting the Parent to struct default, setting the Parent to itself, and setting the Parent to Entity.Null. All of these hits the problem of Parent not being added for some reason.
    3. Try adding the Parent component when we instantiate the Arrow entity. At this point I could have the Parent be the ArrowManagerEntity, an entity that would have components such as arrow count and arrow pooling (maybe). ArrowManagerEntity is currently doing nothing but holding the ArrowEntityReferenceComponent.
      Code (CSharp):
      1.  public void Convert(
      2.             Entity entity,
      3.             EntityManager entityManager,
      4.             GameObjectConversionSystem conversionSystem)
      5.         {
      6.             entityManager.SetName(entity, "ArrowManagerEntity");
      7.  
      8.             ArrowEntity =
      9.                      GameObjectConversionUtility.ConvertGameObjectHierarchy(
      10.                          _arrowEntityPrefab.gameObject,
      11.                          _conversionSettings);
      12.  
      13.             entityManager.SetName(ArrowEntity, "ConvertedArrowEntity");
      14.  
      15.             entityManager.AddComponentData(
      16.                 entity,
      17.                 new ArrowEntityReferenceComponent(ArrowEntity));
      18.  
      19.             entityManager.AddComponentData(
      20.                 entity,
      21.                 new ArrowManagerEntityReferenceComponent(entity));
      22.         }
      Which is then is used in the ArrowShootSystem:

      Code (CSharp):
      1. Entities
      2.                 .WithName("CreateArrowEntityJob")
      3.                 .ForEach(
      4.                     (in ArrowEntityReferenceComponent arrowReference,
      5.                     in ArrowManagerEntityReferenceComponent managerReference) =>
      6.                     {
      7.                         Translation arrowTranslation =
      8.                             new Translation { Value = arrowPosition };
      9.  
      10.                         Rotation arrowRotation =
      11.                             new Rotation { Value = arrowQuaternion };
      12.  
      13.                         Entity arrowEntityInstance =
      14.                             EntityUtility.InstantiateEntity(
      15.                                 arrowReference.Value,
      16.                                 _entityManager,
      17.                                 arrowTranslation,
      18.                                 arrowRotation);
      19.  
      20.                         _entityManager.SetName(
      21.                             arrowEntityInstance,
      22.                             "Arrow");
      23.  
      24.                         _entityManager.AddComponentData(
      25.                             arrowEntityInstance,
      26.                             new Parent { Value = managerReference.Value });
      27.  
      28.                         PhysicsVelocity physicsVelocity =
      29.                             _entityManager.GetComponentData<PhysicsVelocity>(
      30.                                 arrowEntityInstance);
      31.  
      32.                         PhysicsMass physicsMass =
      33.                             _entityManager.GetComponentData<PhysicsMass>(
      34.                                 arrowEntityInstance);
      35.  
      36.                         PhysicsVelocity updatedVelocity = new PhysicsVelocity
      37.                         {
      38.                             Linear =
      39.                                 physicsVelocity.Linear +
      40.                                 BowUtility.CalculateArrowShootVelocity(
      41.                                     arrowTranslation,
      42.                                     arrowRotation,
      43.                                     physicsMass.InverseMass,
      44.                                     bowShotPercentage)
      45.                         };
      46.  
      47.                         _entityManager.SetComponentData(
      48.                             arrowEntityInstance,
      49.                             updatedVelocity);
      50.                        
      51.                     })
      52.                 .WithStructuralChanges()
      53.                 .Run();
      This is where I decided to add the Parent component and have it be ArrowEntityManager. Problem is that for some reason setting that as the Parent immediately stops all physics and just makes the arrow appear in a specific position.
    4. So finally I decided to add the Parent all the way in the job of the ArrowCollisionSystem. I didn't know how to add components inside a ICollisionEventsJob, and it felt like it would violate the separation of needed for Burst compilation, but decided to look into it. Found this forum using EntityCommandBuffer, albeit in a IJobForEachWithEntity<T> job: https://forum.unity.com/threads/addcomponent-from-inside-jobcomponentsystem-job.678730/. Now I'm having trouble finding what the job index is as ICollisionEventsJob.Execute does not provide that information.
    So that's where I am now. Now I'm playing with the idea to add a new component to my arrow called ArrowCollisionDataComponent that would have the following:
    • public bool HasCollided;
    • public Entity CollidedEntity;
    • public float3 PositionOnCollision;
    • public quaternion RotationOnCollision;
    Then I would have another system check which arrows have collided and set up and add the Parent component appropriately. Would like some help either debugging why Parent component isn't getting added or if there is a work around. Any further discussion is also appreciated.
     
  2. fomartin

    fomartin

    Joined:
    Aug 31, 2015
    Posts:
    17
    I've gone ahead and added a new system that checks a new component called ArrowPenetrationComponent.
    Code (CSharp):
    1.  public class ArrowPenetrationSystem : SystemBase
    2.     {
    3.         private EntityManager _entityManager;
    4.  
    5.         protected override void OnCreate()
    6.         {
    7.             _entityManager =
    8.                 World.DefaultGameObjectInjectionWorld.EntityManager;
    9.         }
    10.  
    11.         protected override void OnUpdate()
    12.         {
    13.             Entities
    14.                 .WithName("AttachArrowToPenetratedEntityJob")
    15.                 .ForEach(
    16.                     (ref LocalToWorld arrowLocalToWorld,
    17.                     in ArrowPenetrationComponent arrowPenetrationComponent) =>
    18.                     {
    19.                         if(arrowPenetrationComponent.IsPenetrated)
    20.                         {
    21.                             _entityManager.AddComponentData(
    22.                                 arrowPenetrationComponent.PenetratingArrow,
    23.                                 new Parent
    24.                                 {
    25.                                     Value = arrowPenetrationComponent.PenetratedObject
    26.                                 });
    27.  
    28.                             arrowLocalToWorld =
    29.                                 arrowPenetrationComponent.ArrowLocalToWorld;
    30.                         }
    31.                     })
    32.                 .WithStructuralChanges()
    33.                 .Run();
    34.         }
    Not really happy with it since now I need to run it WithStructuralChanges() instead of having it be run in parallel with Burst. Here's how the ArrowCollisionJob checks out now:

    Code (CSharp):
    1. [BurstCompile]
    2.         struct ArrowCollisionJob : ICollisionEventsJob
    3.         {
    4.             public ComponentDataFromEntity<ArrowPenetrationComponent>
    5.                 ArrowPenetrationGroup;
    6.             public ComponentDataFromEntity<RotationFollowsLinearVelocityComponent>
    7.                 RotationFollowsLinearVelocityGroup;
    8.             [ReadOnly] public ComponentDataFromEntity<PhysicsVelocity>
    9.                 PhysicsVelocityGroup;
    10.             [ReadOnly] public ComponentDataFromEntity<LocalToWorld>
    11.                 LocalToWorldGroup;
    12.  
    13.             public void Execute(CollisionEvent collisionEvent)
    14.             {
    15.                 bool isEntityARotationFollowsLinearVelocity =
    16.                     RotationFollowsLinearVelocityGroup.Exists(collisionEvent.EntityA);
    17.                 bool isEntityBRotationFollowsLinearVelocity =
    18.                     RotationFollowsLinearVelocityGroup.Exists(collisionEvent.EntityB);
    19.  
    20.                 if (isEntityARotationFollowsLinearVelocity && isEntityBRotationFollowsLinearVelocity
    21.                     || !isEntityARotationFollowsLinearVelocity && !isEntityBRotationFollowsLinearVelocity)
    22.                 {
    23.                     return;
    24.                 }
    25.  
    26.                 Entity arrowEntity;
    27.                 if (isEntityARotationFollowsLinearVelocity)
    28.                 {
    29.                     arrowEntity = collisionEvent.EntityA;
    30.  
    31.                     RotationFollowsLinearVelocityGroup[arrowEntity] =
    32.                         new RotationFollowsLinearVelocityComponent() { IsActive = false };
    33.                 }
    34.                 else if (isEntityBRotationFollowsLinearVelocity)
    35.                 {
    36.                     arrowEntity = collisionEvent.EntityB;
    37.  
    38.                     RotationFollowsLinearVelocityGroup[arrowEntity] =
    39.                         new RotationFollowsLinearVelocityComponent() { IsActive = false };
    40.                 }
    41.                 else
    42.                 {
    43.                     return;
    44.                 }
    45.  
    46.                 //TODO: Remove collider or make it not throw any more events.
    47.                 if(ArrowPenetrationGroup[arrowEntity].IsPenetrated)
    48.                 {
    49.                     return;
    50.                 }
    51.  
    52.                 Entity otherEntity = !isEntityARotationFollowsLinearVelocity
    53.                     ? collisionEvent.EntityA
    54.                     : collisionEvent.EntityB;
    55.  
    56.                 ArrowPenetrationGroup[arrowEntity] =
    57.                         new ArrowPenetrationComponent(
    58.                             arrowEntity,
    59.                             LocalToWorldGroup[arrowEntity],
    60.                             otherEntity);
    61.             }
    Still would be interested in a discussion get my other portion in parallel or get it all within ArrowCollisionJob. Thanks!
     
  3. fomartin

    fomartin

    Joined:
    Aug 31, 2015
    Posts:
    17
    Ok figured out how to get it running with BurstCompile.

    Code (CSharp):
    1. using Unity.Burst;
    2. using Unity.Collections;
    3. using Unity.Entities;
    4. using Unity.Jobs;
    5. using Unity.Physics;
    6. using Unity.Physics.Systems;
    7. using Unity.Transforms;
    8.  
    9. namespace JuegosFrantasticos
    10. {
    11.     public class ArrowCollisionSystem : JobComponentSystem
    12.     {
    13.         private BuildPhysicsWorld _buildPhysicsWorld;
    14.         private StepPhysicsWorld _stepPhysicsWorld;
    15.         private EntityQuery _rotationFollowsLinearVelocityGroup;
    16.         private EntityCommandBufferSystem _entityCommandBufferSystem;
    17.         private EntityQuery _arrowEntityGroup;
    18.  
    19.         protected override void OnCreate()
    20.         {
    21.             _buildPhysicsWorld = World.GetOrCreateSystem<BuildPhysicsWorld>();
    22.             _stepPhysicsWorld = World.GetOrCreateSystem<StepPhysicsWorld>();
    23.  
    24.             _rotationFollowsLinearVelocityGroup =
    25.                 GetEntityQuery(new EntityQueryDesc
    26.                 {
    27.                     All = new ComponentType[]
    28.                     {
    29.                         typeof(RotationFollowsLinearVelocityComponent)
    30.                     }
    31.                 });
    32.  
    33.             _entityCommandBufferSystem =
    34.                 World.GetOrCreateSystem<EntityCommandBufferSystem>();
    35.  
    36.             _arrowEntityGroup = GetEntityQuery(new EntityQueryDesc
    37.             {
    38.                 All = new ComponentType[]
    39.                 {
    40.                     typeof(ArrowPenetrationComponent),
    41.                     typeof(LocalToWorld),
    42.                 }
    43.             });
    44.  
    45.             base.OnCreate();
    46.         }
    47.  
    48.         protected override JobHandle OnUpdate(JobHandle inputDependencies)
    49.         {
    50.             JobHandle jobHandle = new JobHandle();
    51.  
    52.             if (_rotationFollowsLinearVelocityGroup.CalculateEntityCount() == 0)
    53.             {
    54.                 return jobHandle;
    55.             }
    56.  
    57.             CollisionJob collisionJob = new CollisionJob
    58.             {
    59.                 PhysicsVelocityGroup =
    60.                     GetComponentDataFromEntity<PhysicsVelocity>(true),
    61.                 LocalToWorldGroup =
    62.                     GetComponentDataFromEntity<LocalToWorld>(true),
    63.                 ArrowPenetrationGroup =
    64.                     GetComponentDataFromEntity<ArrowPenetrationComponent>(),
    65.                 RotationFollowsLinearVelocityGroup =
    66.                     GetComponentDataFromEntity<RotationFollowsLinearVelocityComponent>(),
    67.             };
    68.  
    69.             jobHandle = collisionJob.Schedule(
    70.                 _stepPhysicsWorld.Simulation,
    71.                 ref _buildPhysicsWorld.PhysicsWorld,
    72.                 inputDependencies);
    73.  
    74.             AttachJob penetrationJob = new AttachJob
    75.             {
    76.                 EntityCommandBuffer =
    77.                     _entityCommandBufferSystem.CreateCommandBuffer().ToConcurrent(),
    78.                 ArrowPenetrationArchetypeChunk =
    79.                     GetArchetypeChunkComponentType<ArrowPenetrationComponent>(),
    80.                 EntityChunkType =
    81.                     GetArchetypeChunkEntityType()
    82.             };
    83.  
    84.             jobHandle = penetrationJob.Schedule(_arrowEntityGroup, jobHandle);
    85.  
    86.             return jobHandle;
    87.         }
    88.  
    89.         [BurstCompile]
    90.         private struct CollisionJob : ICollisionEventsJob
    91.         {
    92.             public ComponentDataFromEntity<ArrowPenetrationComponent>
    93.                 ArrowPenetrationGroup;
    94.             public ComponentDataFromEntity<RotationFollowsLinearVelocityComponent>
    95.                 RotationFollowsLinearVelocityGroup;
    96.             [ReadOnly] public ComponentDataFromEntity<PhysicsVelocity>
    97.                 PhysicsVelocityGroup;
    98.             [ReadOnly] public ComponentDataFromEntity<LocalToWorld>
    99.                 LocalToWorldGroup;
    100.  
    101.             public void Execute(CollisionEvent collisionEvent)
    102.             {
    103.                 bool isEntityARotationFollowsLinearVelocity =
    104.                     RotationFollowsLinearVelocityGroup.Exists(collisionEvent.EntityA);
    105.                 bool isEntityBRotationFollowsLinearVelocity =
    106.                     RotationFollowsLinearVelocityGroup.Exists(collisionEvent.EntityB);
    107.  
    108.                 if (isEntityARotationFollowsLinearVelocity && isEntityBRotationFollowsLinearVelocity
    109.                     || !isEntityARotationFollowsLinearVelocity && !isEntityBRotationFollowsLinearVelocity)
    110.                 {
    111.                     return;
    112.                 }
    113.  
    114.                 Entity arrowEntity;
    115.                 if (isEntityARotationFollowsLinearVelocity)
    116.                 {
    117.                     arrowEntity = collisionEvent.EntityA;
    118.  
    119.                     RotationFollowsLinearVelocityGroup[arrowEntity] =
    120.                         new RotationFollowsLinearVelocityComponent() { IsActive = false };
    121.                 }
    122.                 else if (isEntityBRotationFollowsLinearVelocity)
    123.                 {
    124.                     arrowEntity = collisionEvent.EntityB;
    125.  
    126.                     RotationFollowsLinearVelocityGroup[arrowEntity] =
    127.                         new RotationFollowsLinearVelocityComponent() { IsActive = false };
    128.                 }
    129.                 else
    130.                 {
    131.                     return;
    132.                 }
    133.  
    134.                 //TODO: Remove collider or make it not throw any more events.
    135.                 if(ArrowPenetrationGroup[arrowEntity].IsPenetrated)
    136.                 {
    137.                     return;
    138.                 }
    139.  
    140.                 Entity otherEntity = !isEntityARotationFollowsLinearVelocity
    141.                     ? collisionEvent.EntityA
    142.                     : collisionEvent.EntityB;
    143.  
    144.                 ArrowPenetrationGroup[arrowEntity] =
    145.                         new ArrowPenetrationComponent(
    146.                             arrowEntity,
    147.                             LocalToWorldGroup[arrowEntity],
    148.                             otherEntity);
    149.             }
    150.         }
    151.  
    152.         [BurstCompile]
    153.         private struct AttachJob : IJobChunk
    154.         {
    155.             public EntityCommandBuffer.Concurrent EntityCommandBuffer;
    156.             public ArchetypeChunkComponentType<ArrowPenetrationComponent>
    157.                 ArrowPenetrationArchetypeChunk;
    158.  
    159.             [ReadOnly]
    160.             public ArchetypeChunkEntityType EntityChunkType;
    161.  
    162.             public void Execute(
    163.                 ArchetypeChunk chunk,
    164.                 int chunkIndex,
    165.                 int firstEntityIndex)
    166.             {
    167.                 NativeArray<Entity> entities =
    168.                     chunk.GetNativeArray(EntityChunkType);
    169.                 NativeArray<ArrowPenetrationComponent> arrowPenetrationArray =
    170.                     chunk.GetNativeArray(ArrowPenetrationArchetypeChunk);
    171.  
    172.                 for (int i = 0; i < entities.Length; ++i)
    173.                 {
    174.                     if (arrowPenetrationArray[i].IsPenetrated)
    175.                     {
    176.                         EntityCommandBuffer.AddComponent(
    177.                             chunkIndex,
    178.                             entities[i],
    179.                             new Parent
    180.                             {
    181.                                 Value = arrowPenetrationArray[i].PenetratedObject
    182.                             });
    183.  
    184.                         EntityCommandBuffer.SetComponent(
    185.                             chunkIndex,
    186.                             entities[i],
    187.                             arrowPenetrationArray[i].ArrowLocalToWorld);
    188.                     }
    189.                 }
    190.             }
    191.         }
    192.     }
    193. }
    Still unsure why the heck Parent component is removed from the arrow when I added that component. Now if you can excuse me, I need to go back and refactor some stuff to follow this Burst paradigm.
     
  4. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    714
    I see that you're using AddComponent() with new Parent { Value = xxxx; }, but in order to properly reparent, don't you also need to add the arrow to the new parent's DynamicBuffer of children?

    I'm asking this not because I know the answer, but because I'm about to do something similar and my initial theory is that in order to do a full "reparent" at runtime we would need to do these steps:

    1) if the child has an old parent, remove the child from the old parent's buffer of children.
    2) set the child's new parent (like you did).
    3) add the child to the new parent's buffer of children.
     
  5. fomartin

    fomartin

    Joined:
    Aug 31, 2015
    Posts:
    17
    I unfortunately wasn't able to find an answer. I do know for a fact the re-parenting is working using the EntityDebugger. In any case, the conversation moved to the Physics DOTS forum (I didn't know that existed when creating this thread). There is a couple others trying to help though I'm taking a break from solving this at the moment. https://forum.unity.com/threads/und...-physics-execution-order.964994/#post-6352599
     
  6. varnon

    varnon

    Joined:
    Jan 14, 2017
    Posts:
    52
    Alternatively, I've found that I can give something a parent, but if I also give something children, all link components are removed. I can add the components like I see them when parented game objects are converted, but something isn't right. I've also taken a break from it for the moment. I wonder if it is an order of operations thing, and the transforms parent systems need something a little more specific that we are not noticing.
     
  7. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    714
    Really? So unit.physics is smart enough to recognize that a parent changed and perform the other two steps automatically (removing from the old parent list of children, and adding it to the new parent's list of children)?

    Sorry I can't help much with the arrow collision physics part... I'm still just learning unity.physics.
     
  8. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    547
    Unity.Entites can do auto reparent. and these a hidden SystemStateComponentData call PreviousParent. that help with that.
    So user should just add/remove/change Parent component and leave Child buffer as it is.
     
    Sarkahn and lclemens like this.
  9. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    547
    Use EntityCommandBuffer to add parent component.
     
  10. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    714
    Initially I wrote a function that just adds the parent (like you suggested), but I noticed that it was not getting added as a child to the parent. So then I wrote a more complex function to add the child to the parent's list of children and remove the child from the previous parent's list of children. It did not work, and I don't know why.

    Then I discovered an easier way... it is possible, like you said, to just add the parent to the child and let Unity.Entities do the "routing", HOWEVER, it's very important that the child has a LocalToParent object!

    Code (CSharp):
    1. if (!EntityManager.HasComponent<LocalToParent>(child)) { EntityManager.AddComponentData(child, new LocalToParent()); }
    Once I added that, things started working as expected. For GameObjects, it's so simple - just child.transform.SetParent(); , but with DOTS we get to figure it out by trial and error.
     
    Sarkahn likes this.
  11. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    547
    Oh, I never noticed that. I use GameObject convention all the time. So there's always a LocalToParent, Translation and Rotation. It would be much easier to use GameObject and GameObject prefab as entity archetype.
     
  12. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    714
    I am also using a GameObject. I made a GameObject at the root level in the class hierarchy with a Sprite Renderer component and ConvertToEntity. The resulting entity did not have a LocalToParent component. I think that if the GameObject resides at the root level, the ConvertToEntity script won't add LocalToParent. So I had to make a converter script that adds Parent and LocalToParent.

    Code (CSharp):
    1. using Unity.Entities;
    2. using UnityEngine;
    3. using Unity.Transforms;
    4.  
    5. public class ChildConverter : MonoBehaviour, IConvertGameObjectToEntity
    6. {
    7.     public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    8.     {
    9.         dstManager.AddComponent<Parent>(entity);
    10.         dstManager.AddComponent<LocalToParent>(entity);
    11.     }
    12. }
     
  13. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    547
    Oh, sorry while I was typing LocalToParent I was thinking LocalToWorld...
    LocalToParent do needs to be added
     
    lclemens likes this.