Search Unity

Trouble with Raycast going through initial object.

Discussion in 'Physics' started by JoeTheGG, Oct 22, 2016.

  1. JoeTheGG

    JoeTheGG

    Joined:
    Aug 18, 2013
    Posts:
    42
    Hey all, I am noticing some weird behavior where randomly my bullet object goes straight through the first object and hits the object behind it. Currently I'm using a standard raycasting procedure (not RaycastAll), and no weird settings in my collision matrix.

    99% of the time it works just fine, but 1 in 100 shots will go straight through.

    I was wondering if anyone else had ever had issues with raycast not hitting the first thing in it's path.

    Posted a pic below for reference.
     

    Attached Files: