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.

Bug Unity.Physics breaks ComponentLookup<LocalToWorldTransform>

Discussion in 'Entity Component System' started by Unique-Player, Dec 6, 2022.

  1. Unique-Player

    Unique-Player

    Joined:
    May 6, 2017
    Posts:
    42
    As soon as i add Unity.Physics package Component "LocalToWorldTransform" stops working, tested on new project. I noticed that Entities version changes to exp12 after Unity Physics added to project.

    Unity Physics - 1.0.0 - exp12
    Entities 1.0.0 - exp8
    Unity version 2022.2.0b

    Script code to see the issue.
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using Unity.Entities;
    4. using Unity.Mathematics;
    5. using UnityEngine;
    6. using UnityEngine.EventSystems;
    7.  
    8. public partial struct test : ISystem
    9. {
    10.     ComponentLookup<LocalToWorldTransform> m_LocalToWorldTransformFromEntity;
    11.  
    12.     public void OnCreate(ref SystemState state)
    13.     {}
    14.  
    15.     public void OnDestroy(ref SystemState state) { }
    16.  
    17.     public void OnUpdate(ref SystemState state)
    18.     {
    19.  
    20.     }
    21. }
    22.  
     
  2. Salmakis

    Salmakis

    Joined:
    May 14, 2018
    Posts:
    15
    there is an 1.0.0-pre15 version out
    not sure if it is fixed there but its worth a try.
     
  3. Thygrrr

    Thygrrr

    Joined:
    Sep 23, 2013
    Posts:
    391
    There are two issues with Physics and transforms for baked entities, check my thread for some ideas about what might be going wrong (the problem was silent before, now in the newest 1.0.0-pre.15, it's exacerbated by PhysicsBaker crashing because PropagateLocalToWorld is added to the entity twice.)

    https://forum.unity.com/threads/what-causes-non-uniform-scale.1372038/