Search Unity

Feedback Major rigidbody bug in Unity 2017.4.26 - .27?

Discussion in 'Editor & General Support' started by CoolJosh3k, May 20, 2019.

  1. CoolJosh3k

    CoolJosh3k

    Joined:
    Dec 3, 2016
    Posts:
    145
    After updating to Unity 2017.4.27f1 I notice that game objects that have a child that also have a rigidbody component act very strangely.

    While previously I had no issues, now the child refused to move horizontally, but will move vertically. When this happens the transform position vector fails to reflect the real local position. This is done with the parent being a rolling ball. If I only rotate the ball, the child's transform position vector remains the same, but if I do both the values become very incorrect.

    I have some raw footage recorded if this helps, but I'd need to edit it before sharing if it is needed.

    I have never filled out a bug report before, so I figured it'd best to get some feedback and share what I have noticed.

    I tested after downgrading to 2017.4.26f1 too, but I found it happens there too.

    The only thing I could figure out as a root cause was when setting transform.rotation of the child to Quaternion.identity. I do this in the update loop to prevent rotation.

    After uninstalling Unity and then starting a fresh install to 2017.4.25f1 I no longer have the issue at all.

    The main reason so many children in my project have Rigidbody components is due to them having Colldier components. It is my understanding that if you have a Collider your should always have a Rigidbody too.
     
  2. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    You should never have a rigidbody that has a rigidbody as a child.
    Each rigidbody registers transforms with colliders to their own control, which will lead to unexpected behaviour if they're combined.

    And no, you don't need rigidbodies on each and every collider.
    Attach them to only those objects that do move dynamically via the physics.
    Static objects do not suffer any performance impacts from not having rigidbodies since (I think?) 5.1.
     
  3. CoolJosh3k

    CoolJosh3k

    Joined:
    Dec 3, 2016
    Posts:
    145
    It was my understanding that the issue with rigidbody components on children was fixed a while ago.

    It makes sense to have something in future to updates to prevent doing this, if it really is an issue. I just cannot imagine this being intended behavour in the latest updates, even if a developer were to put a rigidbody on a child.

    Thanks for the response.

    How should one solve the issue when they need to have physics on both the parent and child? Using joints or some other class? I am inclined to just write my own velocity functions, independant of Unity's built in physics system.
     
  4. ValdecoTFG

    ValdecoTFG

    Joined:
    Dec 2, 2016
    Posts:
    1
    Same issue here. I work on a 4 years old mobile game which has more than 900 mission scenes, we have been upgrading it since Unity 3.5, but now many of them are broken when upgrading from 2017.4.25f1 to 2017.4.26f1. Should an LTS bump change the physics behavior so much?