Makes the collision detection system ignore all collisions between collider1
and collider2
.
// Instantiate a bullet and make it ignore collisions with this object. var bulletPrefab : Transform; function Start () { var bullet = Instantiate(bulletPrefab) as Transform; Physics.IgnoreCollision(bullet.collider, collider); }
using UnityEngine; using System.Collections; public class Example : MonoBehaviour { public Transform bulletPrefab; void Start() { Transform bullet = Instantiate(bulletPrefab) as Transform; Physics.IgnoreCollision(bullet.collider, collider); } }
import UnityEngine import System.Collections public class Example(MonoBehaviour): public bulletPrefab as Transform def Start() as void: bullet as Transform = (Instantiate(bulletPrefab) as Transform) Physics.IgnoreCollision(bullet.collider, collider)