Search Unity

Runtime parented physics object intended behaviour

Discussion in 'Physics for ECS' started by Jawsarn, Jan 22, 2020.

  1. Jawsarn

    Jawsarn

    Joined:
    Jan 12, 2017
    Posts:
    245
    Is/will always the intended behavior for realtime parented physics entities to not move the collider?
    It solves some problems and wondering if this is a solution that won't break in the future because this wasn't intended.
     
  2. Adam-Mechtley

    Adam-Mechtley

    Administrator

    Joined:
    Feb 5, 2007
    Posts:
    290
    Hi!

    Could you provide a little more detail, please?
     
  3. Jawsarn

    Jawsarn

    Joined:
    Jan 12, 2017
    Posts:
    245
    If you create two entities, where lets say both are dynamic. If you parent one of them to the other, the translation which is fed into the physicsWorld will be in localSpace and not worldSpace. Some might see this as a bug, where you would want to use the localToWorld instead to feed the physics system, but in my case I use this "bug/feature"(+layer change) to simulate interior physics of moving ships, as the rendering will follow world space - but physics will be calculated in local space which makes things easier.
     
  4. Adam-Mechtley

    Adam-Mechtley

    Administrator

    Joined:
    Feb 5, 2007
    Posts:
    290
    Sure it makes sense. I think the actual way we want to handle this though is not by exploiting oddities of the transform system (it's already complex enough!) but instead making it easier to spin up and simulate isolated physics worlds
     
  5. Jawsarn

    Jawsarn

    Joined:
    Jan 12, 2017
    Posts:
    245
    Sure. If spinning up isolated world costs less than this approach with layers that would be super neat. Currently it ties neatly together with networking and rendering, as you only sync local positions to parent. So for my case these entities would be required to be simulated in local space either way.
     
  6. Jawsarn

    Jawsarn

    Joined:
    Jan 12, 2017
    Posts:
    245
    Aaaaand you already broke my game through this update on this subject x)
     
  7. Jawsarn

    Jawsarn

    Joined:
    Jan 12, 2017
    Posts:
    245