Ignoring Collisions between Objects.

I have a Player that is a plane and shoots missiles, but the missiles keep bumping the plane. How would I solve this issue in JavaScript,

I found a solution in C# : Ignore Collisions by Tag SOLVED! - Unity Engine - Unity Discussions

but I don’t know how to convert it into JavaScript.

Also, it is a 2D game, so I’ve tried to use: “Physics2D.IgnoreCollision(Player.collider2D, collider2D);” but still no results.

Things I’ve tried:

function OnCollisionEnter2D (Other: Collision2D){
if(Other.gameObject.tag == "Player"){
        Physics2D.IgnoreCollision(Player.collider2D, collider2D);
    }
}
function Start (){
    Physics2D.IgnoreCollision(Player.collider2D, collider2D);
}

Here is the script reference I’ve tried to understand with little success: Unity - Scripting API: Physics2D.IgnoreCollision

I suggest you look at the layer system. You can set in the physics settings which layers will interact with what.

For example, in your case you can put the player collisions on one layer and the enemy collisions on another. Then you can set it up so that enemies will only hit the player and not each other, or the player will only hit enemies and not interact with its own layer.

If The Missile was in layer 9 in “Missile”, and that player was in layer 8, “Player”, what would I put in my code to make them not collide? I can’f figure it out,

Nothing. You would setup the phsyics collision matrix so they ignore each other.

its under Project->Physic Settings (or something along those lines)

It wil be a grid of checkboxes with the layer names going along the top and side

I was trying to use the matrix, and it didn’t work… Until I found out my Player was on the Default layer, thanks for your help, I appreciate it.