Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Rigidbody - Why does my issue get fixed by doing THIS?

Discussion in 'Physics' started by JanDawid, May 28, 2020.

  1. JanDawid

    JanDawid

    Joined:
    Jul 7, 2014
    Posts:
    283
    I'm working on a VR project that is near completion so unfortunately I can't provide an example, if an isolated example is needed I'll try to provide one. The issue is that when the player picks up an object and holds it, the object will start moving around a little independent from the hand (like it overcompensates for the velocity of the hand). Anyway, this issue has only recently randomly popped up. At first it wasn't happening in the builds but now it is. Unity randomly and indiscriminantly will choose which objects this happens to in the builds and seems to happen for each and every object in the Editor. At one point I duplicated an object and it happened to one of the duplicates but not the other. So I can 99% guarantee that this isn't an issue of my coding. I've tried all different interpolation and collision detection modes, even if the object is kinematic it can happen (and I ensured that the hand physics object it was attached to and following wasn't doing this).

    So I found a fix. I select any variable in the inspector for that item's rigidbody and change it to anything. Fixed. Changing these same variables in code doesn't help. So what could I possibly do at runtime, especially in a build, that could replicate this same solution? What happens when I change one of the values in the inspector that doesn't happen when I change it in code? Is there some kind of "refresh component" function I could use? I'm really stumped here. I don't mind if it is a bug just as long as I can get some kind of workaround.
     
  2. JanDawid

    JanDawid

    Joined:
    Jul 7, 2014
    Posts:
    283
    Bump since this still needs solving.