I have a game in which there is going to be three different enemies; one that runs away from you, one that chases you and one that doesn’t move. I’ve managed to make a bullet shoot when you click, but i only want it to hit one type object and pass through or destroy itself when it hits the others, but if it could bounce off the terrain that would be wonderful. I have basically no experience with coding, i copy most of them from the web.
-Tom
I’m quotating from Unity docs: “A collider configured as a Trigger (using the Is Trigger property) does not behave as a solid object and will simply allow other colliders to pass through. When a collider enters its space, a trigger will call the OnTriggerEnter function on the trigger object’s scripts.”
I guess this is what you need, you just tick the “Is Trigger” option in the inspector for all objects you don’t want to be solid.
I think what you are looking for is Layer based collision detection. Unity - Manual: Layer-based collision detection
Place the objects you want to collide with in one layer and the ones you want to pass through in another layer. Then uncheck collision detection between the player layer and the pass through layer.