Throwing weapon that doesn't fall through ground

Hello I am trying to create a knife for my character to throw. However I want it to be a trigger so it can go through enemy colliders and destroy them but at the same time I want it to be able to detect the floor collider and not fall through, allowing it to be used again. How would I do this? Can I have one collider with different reactions to different colliders or do I have to place 2 colliders on it, one that is a Trigger and one that is not. Thank you for your help!

You can adjust collider layers in Unity.

Sorry Dx I still can’t seem to get it to work. If I use the collision matrix and uncheck the player tag then it ignores them and I cant detect anything. If I turn off the plane, then it falls down through the ground/ I think I underestimated how difficult this weapon would be. So basically its a knife that you can throw and pick back up and throw again. I assume it has to have a Trigger Collider so it can go through other enemy colliders and destroy them but if I make it a trigger then it falls through the ground. Also if I place a on trigger enter command and tell it to look for a player tag then it destroys my character when I go over the item to pick it up. I’m still new to unity so any type of advice would help. Thank you MilKID for your help earlier.

One cheap band-aid solution to add to what you’ve done so far is to have a child object on your enemy with a trigger collider, but with a different collision layer from it’s parent which is able to detect your knife projectile. It however requires this child object to communicate to its parent that a knife has touched it. This solution will work but is horribly messy, fine for a prototype but I wouldn’t recommend using it long term.

If your enemy characters use trigger colliders instead that would be the far easier solution, although that depends on your game’s needs.

One method, though I haven’t tried it myself, might be to change the trigger property of the knife’s collider based on what it has hit. It would start off as a trigger, but switches to not being a trigger upon triggering on anything other than enemies.

I never considered having a trigger change the collider type. That would fix the knife falling through the ground issue but wouldn’t making the enemy use a trigger collider not cause them to fall off the map ?

Like I said, it depends on the needs of your game, none of which you have mentioned. If it was topdown, gravity is no issue.

Oh my apologies, Its uses gravity and is a 3rd person fighting game. However the good news is I worked it out! thank you all of helping me !!