Hey Guys,
I’ve been really stuck on a problem. I have a basic home in Unity3d and I am trying to add a lightswitch that the person can touch with their SteamVR Controller to turn on and off the lights. But I am not able to get an OnTriggerEnter event to fire when passing the controller through the lightswitch.
My lightswitch is a box collider. I’ve tried it with a rigid body and without. And as isKinematic and not.
I have a sphere collider and a rigidbody attached to the model under both Controller(left) and Controller(right) of the CameraRig Object.
Finally, I have the following Script Attached to the Models, but have also tried it on the switch.
using UnityEngine;
using System.Collections;
public class SwitchCollision : MonoBehaviour {
void OnCollisionEnter(Collision col)
{
Debug.Log("Switch Collision");
}
void OnTriggerEnter(Collider col)
{
Debug.Log("Switch Trigger");
}
}
I can’t get either to print. Can you see what I am missing?