- Home /
How to avoid a gameobject inside another while they're in collision?
Basically I create a cube (A) and another cube (B). Both of them have BoxCollider and Rigidbody. I also freeze the constraints of cube A and only rotation and Y-position contraints of cube B so they wont rotate around or go anywhere. No gravity or kinematic also. When I put the cube B in the center of cube A which is bigger, collision won't push cube B out of cube A. But if I just move B a little bit out of center but still inside cube A, It would be pushed out immidiately.
So what I want to is to make cube B pushed out of A in every case. Maybe by collison, setting up Physics or any tricks that would be OK. I have even tried setting Fixed Timesteps to .01 or use Contiuous Dynamic Collision or PhysicsManager changes but none of them help. The same problem happens when I move B from outside into the inside part of A. Anyone has solved this kind of problem, pleases? Thanks. btw, I am using Unity 2018.1.
Your answer
Follow this Question
Related Questions
3D enemies keep sliding on the terrain 1 Answer
I want my Player to have collision physics 1 Answer
Keeping player stationary and let physics affect... 0 Answers
Continuous collision detection - unnatural behaviour 0 Answers
Handling colliders on hundreds of asteroids (not procedural asteroids) ...URGENT 3 Answers