Collider.isTrigger Manual     Reference     Scripting  
Scripting > Runtime Classes > Collider
Collider.isTrigger

var isTrigger : bool

Description

Is the collider a trigger?

A trigger doesn't collide with rigid bodies. Instead it sends OnTriggerEnter, OnTriggerExit and OnTriggerStay message when a rigidbody enters or exits the trigger.

JavaScripts
// Turns the attached to collider into a trigger.
collider.isTrigger = true;

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void Awake() {
collider.isTrigger = true;
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def Awake():
collider.isTrigger = true