Search Unity

Raycast Ignoring Probuilder Objects

Discussion in 'Physics' started by KamikazeHerb, Jun 25, 2019.

  1. KamikazeHerb

    KamikazeHerb

    Joined:
    Jun 25, 2019
    Posts:
    1
    I've been trying to use raycast to detect if my AI guards in my game can see the player. The problem I'm having is that the rays are going straight through objects I've created using probuilder. Any regular unity objects are hit by the raycast. There isn't anything wrong with my code as far as I can tell, as it works exactly as it should with regular Unity objects just not with probuilder ones. My player can collide with the probuilder objects fine, as my map is made almost entirely out of them. Any help would be hugely appreciated.

    Edit: Solved, turns out it was a problem with Layers
     
    Last edited: Jun 25, 2019
    filipbork7 likes this.