Counting OnEnterStay or other methods

Hi everyone. I am in the process of coding a game for a college class but I am running into some logical problems with OnTriggerStay and C# in general since I studied mainly Java in High school. Is there a way to count the number of time OnTriggerStay is called and store it in a variable? It currently displays the number of frames its called in the console. I also wondered if its possible to use FixedUpdate to call OnTriggerStay but I dont know much. If anyone could help that would be great. Sorry for the wall of text.

Please read the manual for “OnTriggerStay” Unity - Scripting API: Collider.OnTriggerStay(Collider)

You will see that this callback is called by the physics timer (with good reason of course), so basically it is already called from FixedUpdate!

To store the number of times the OnTriggerStay is called is very easy and with your Java background trivial to give you an example. But here it is:

public int OnTriggerStayCounter;

    protected void OnTriggerStay(Collider other)

Could you explain what you are trying to do exactly?