Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Question The procedure of addding an articulation body component

Discussion in 'Physics' started by yangcookie_, Feb 7, 2021.

  1. yangcookie_

    yangcookie_

    Joined:
    Sep 27, 2019
    Posts:
    10
    hi

    I have a quick question for Articulation Body.

    Could any body explain the consequence of below situation?
    or had an experience like this?

    Here is the situation.
    I've added articulation body component through script.

    First articulation body was added in child B.
    And second articulation body was added in parent A.

    Then, I tried to move a Object A with ArticulationBody.TeleportRoot() method.
    The problem is that the object A was never translated where I've desired!


    BUT, when I disable the articulation body(uncheck the compoent) on Child B and re-enable the component(check it again), it's working correctly what I want.
     
  2. AlTheSlacker

    AlTheSlacker

    Joined:
    Jun 12, 2017
    Posts:
    326
    I think this is due to how articulation bodies get created. If you create one manually in the inspector you will see that if the there is no articulation body previously in the hierarchy then the newly created body will be a root body, with no parent. Adding a parent in the inspector updates the first body to make it a child of the second (parent) body. I assume this last phase is coded into the editor or more likely some return values from PhysX and is not happening for you until you disable/enable the child.

    I can see how this can be considered a bug - especially as I don't think there is a way to allocate a parent via script.

    The fix is to create your articulation bodies from the top down, it then works as expected.
     
    Last edited: Feb 8, 2021
  3. yangcookie_

    yangcookie_

    Joined:
    Sep 27, 2019
    Posts:
    10
    Thanks for comment. I'm new with Articulation Body. I'm struggling with controlling that components.

    It seems that is just way of working for the ArticulatioBody like you mentioned.