I have a Cube with a Box Collider attached. How do I set isTrigger to true using code?
Here’s what I found on a 2012 forum post… but sadly gives a compiler error “Definition not found for isTrigger”.
using UnityEngine;
using System.Collections;
public class HitTrigger : MonoBehaviour {
// Use this for initialization
void Start () {
collider.isTrigger = true;
}
// Update is called once per frame
void Update () {
}
}