Search Unity

Collision Weird when a boxCollider with high speed collides with a sphereCollider

Discussion in 'Physics' started by joeyxiong1994, Aug 10, 2019.

  1. joeyxiong1994

    joeyxiong1994

    Joined:
    Apr 18, 2017
    Posts:
    20
    Hi I have an archery game. I shoot arrows which has Rigidbody and a boxCollider attached. So when my arrow hit something, I set it FreezeAll to stop it's position and rotation like this: Screen Shot 2019-08-10 at 10.20.47.png

    My issue is when I hit a normal box collider, it's good like this: Screen Shot 2019-08-10 at 09.47.09.png

    Stoped as what I expected.

    But when I hit a sphere or a capsule:
    Screen Shot 2019-08-10 at 09.49.37.png

    you see sometimes the arrow jumped to the other position. Like I aimed in front of me, but it jumped to the left side a little bit like how my image above shows. Can anyone explain to me why this happens? And how to fix it? Thanks!


    As addition to this issue, only when I hit the sphere not perpendicular that much, it would happen. I guess it's because my arrow speed is too high, and even though I already used collision mode -> continuously dynamic. It still penetrate the sphere a little bit before it's detected for collision. So it automatically push it back to the nearest point automatically. If it's in this case, how should I prevent this?
     
    Last edited: Aug 10, 2019
  2. Aseemy

    Aseemy

    Joined:
    Aug 22, 2015
    Posts:
    207
    Cant say why you face the issue that you do, but here is an alternative way to do this. When the arrow hits the collider, get the point of contact and manually place the arrow there.
    You can move the arrow a bit deeper inside based on the angle of shot so it would look better.
     
  3. FuhaoXie

    FuhaoXie

    Joined:
    Nov 18, 2016
    Posts:
    26
    I have the same problem, the arrow contact point is very depart from arrow collider in high speed, sepreation can be 1 or 2