Setting IgnoreCollision on Network spawned objects. (Unet)

I’m using the new Unet and got some problems with the NetworkServer.spawn method and collisions.

[Command]
public void CmdSpawnProjectile(Vector2 position, Vector2 direction) {
    GameObject proj = (GameObject) Instantiate(projectile, position, Quaternion.identity);
    Physics2D.IgnoreCollision(proj.GetComponent<Collider2D>(), GetComponent<Collider2D>());
    proj.GetComponent<Rigidbody2D>().velocity = direction * force;
    Destroy(proj, 2f);
    NetworkServer.Spawn(proj);
}

The ignore collision works fine on the host as expected. But that won’t apply to the other clients which ofc is logical. The question is how to apply the Physics2D.IgnoreCollision on the clients as well. Everything works perfectly except the projectiles spawned on the clients collides with the player who spawns them.

(Simply spawning the projectiles outside the collision of the spawner is not a option.)

set it in OnStartClient() on a NetworkBehaviour script on the projectile

My solution after some diving into the API was:

------- Projectile class -------

[SyncVar]
public NetworkInstanceId spawnedBy;

// Set collider for all clients.
public override void OnStartClient() {
	GameObject obj = ClientScene.FindLocalObject(spawnedBy);
	Physics2D.IgnoreCollision(GetComponent<Collider2D>(), obj.GetComponent<Collider2D>());
}

------- Spawner class -------

    [Command]
public void CmdSpawnProjectile(Vector2 position, Vector2 direction, NetworkInstanceId netId) {
	GameObject proj = (GameObject) MonoBehaviour.Instantiate(projectile, position, Quaternion.identity);
	proj.GetComponent<Rigidbody2D>().velocity = direction * force;
	proj.GetComponent<Projectile>().spawnedBy = netId;
	NetworkServer.Spawn(proj);
}