I am trying to use a the default onTrigger methods, but they don’t seem to be activating. I’ve 2 basic game objects, each with a script attached.The asteroid is what I want to act as a trigger, but I don’t the console output that I expect from the code.
using UnityEngine;
using System.Collections;
public class AsteriodController : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void onTriggerEnter(Collider other){
Debug.Log(gameObject.name + "Object entered the trigger");
}
void onTriggerStay(Collider other){
Debug.Log(gameObject.name + "Object is within the trigger");
}
void onTriggerExit(Collider other){
Debug.Log(gameObject.name + "Object exited the trigger");
}
}
Here is a picture of my asteroid with collider, which I want to call the trigger method:
And here is the player UFO, which I want to activate the trigger: