How to ignore collision between two objects
- by eren_trigger
I have a player that shoots in the direction that it is facing. However, the shot that is created when I click, also destroys the player. How would I make the shot ignore collision with the player? Or better yet, how to make a shot destroy anything it touches and destroy itself without affecting the player?
This is the code that controls collisions:
function OnTriggerEnter (col : Collider) {
Destroy(col.gameObject);
}
The shot is a trigger, but the player isn't. Not sure if this changes anything in this case.
Thanks in advance.
EDIT: http://gfycat.com/TediousAridFeline