Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

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

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

  1. Jakeiiii

    Jakeiiii

    Joined:
    Jul 7, 2014
    Posts:
    258
    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. Jakeiiii

    Jakeiiii

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