Search Unity

Colliders

Discussion in 'Visual Scripting' started by Deleted User, Feb 23, 2021.

  1. Deleted User

    Deleted User

    Guest

    I have a game where an object moves and when it hits a sprite it dies, but i have a box collider where it runs on but in my script when it hit's a collider it supposes to die, so then when play the game it dies instantly. What can I do so it doesn't die on the box collider it runs on
     
  2. Haneferd

    Haneferd

    Joined:
    Feb 3, 2018
    Posts:
    36
    Have you tried to use different layer settings on the different objects, so basically: For the enemy or hazard layer, you check if the collider belongs to them and then dies, so if hitting a collider with another layer it will survie and be happy
     
  3. Deleted User

    Deleted User

    Guest

    I didn't really understand