Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Selective Collisions?

Discussion in 'Physics' started by IchBinJager, Jan 15, 2015.

  1. IchBinJager

    IchBinJager

    Joined:
    Dec 23, 2014
    Posts:
    127
    Hey, I've a question; Is it possible I could enable colliders to selectively collide only under certain circumstances? Like, for example; I have a grenade which is thrown that produces a volume of smoke; I need the smoke to block AI vision therefore I need it return that it was struck in a raycast. However, say I have a projectile as a RigidBody but I need it to pass through smoke, as smoke clearly isn't solid to a bullet.

    Is there a way I could do this?
     
  2. IchBinJager

    IchBinJager

    Joined:
    Dec 23, 2014
    Posts:
    127
    Does a trigger still get registered from a Raycast?
     
  3. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,618
    you can setup collision layers in project settings -> physics.
     
    Cpt Chuckles likes this.