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. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Unity Phyisics using LocalToWorld

Discussion in 'Physics for ECS' started by Roycon, Dec 10, 2019.

  1. Roycon

    Roycon

    Joined:
    Jul 10, 2012
    Posts:
    50
    Hi All

    I'm wanting to use the physics system with transforms (parents and children) and only the Cast* methods (at the moment), my entitys are a child of a Ship which moves and some of those entities move within the ship too but none move with physics. I'm hoping to just use the Physics system as a query engine

    For a quick test I removed Translation and Rotation and used LocalToWorld, I also removed the code that removes the Parent link and it worked!! almost

    I have some super weird rotations going on and I'm wondering if anyone has any ideas the render mesh systems render correctly.

    Also is there any plans to integrate better with the Transform System, specificly child parents

    upload_2019-12-10_21-14-45.png
     
  2. Roycon

    Roycon

    Joined:
    Jul 10, 2012
    Posts:
    50
    Turns out this was actually a easy fix, all I needed to do was recreate the quaternion instead of the one provided by LocalToWorld, I now have colliders attached to enitities in the hierarchy.

    Still have no idea what other effects this could have, but for now seems to work fine