Search Unity

2 Rigidbodies will overlap when 1 is given a velocity

Discussion in 'Physics' started by plockhartt17, Dec 12, 2017.

  1. plockhartt17

    plockhartt17

    Joined:
    Nov 14, 2016
    Posts:
    10
    Hi,

    I have 2 rigidbodies in a 3D game. Both have their rotations frozen, and their z position frozen. When 1 is given a velocity in the direction of the 2nd rigidbody (which occurs every frame in a FixedUpdate call), if the velocity is around 4 then it will move through the other rigidbody (though I can see/feel some resistance). If the velocity is less (around 2), the collision will successfully occur.

    How can I stop the rigidbodies from overlapping? I have tried changing the interpolation and the Collision Detection mode. Two things I noticed is; if I increased the fixedDeltaTime from 30 to 60 then it resolves correctly, and if I remove the rigidbody from the 2nd object, the collision works. However, neither of those solutions are suitable for my project.

    Any advice would be appreciated. I have gone into the Physics Settings of the project and tried tweaking some of the values as that is what similair issues have suggested, but I have got nothing to work so far.

    Thanks.