OnTriggerStay' does not exist in the current context

im just trying to get the console to print a simple message when a collision trigger is active. This is my c# code. I guess im missing some aspect of this… i’ve only tried it 50 different ways.

using UnityEngine;
using System.Collections;

public class ConsoleLogVectorPos : MonoBehaviour {

	void test() // collision in console
	{
		
		OnTriggerStay(Collider) ;
	
		
		Debug.Log ("Collision");
		
	}

}

The compiler is okay with it. Unity however shows this message →

“ConsoleLogVectorPos.cs(9,17): error CS0103: The name `OnTriggerStay’ does not exist in the current context”

If someone could school me on this. that’d be greeeaaaat.

The OnXxxxXxxx family, the whole family not just OnTriggerXXX or OnCollisionXXX but also OnMouseXXX and other methods called events are not called in any script. They are events so they are waiting for something to trigger their call.

All you do is implement them, then they get called by the engine when it is the right time.