Start, Awake, Update. Any other ways to call functions from an empty GameObject?

So I know that I can call functions that I write in my Start(), Awake(), Update(), and FixedUpdate() functions, but is there any other place or any other way to call custom functions on an empty GameObject?

Basically, there are a lot of functions that I want to happen just once, but that are inappropriate to call from Start() or Awake(). I’m currently using booleans to turn them on and off inside Update(), but this seems tedious and backwards. Is there a better way to call a particular function only once when I need it? Do I Instantiate() a prefab with another script attached with the function being called in its Start()? That seems wasteful. Advice?

It depends on when you need to call them.

When the component is enabled or the game object is activated? Use OnEnable(). (Or OnDisable() when it’s disabled/deactivated.)

On collision with another object? Use OnCollisionEnter() or OnTriggerEnter().

The whole list is on the MonoBehaviour reference: Unity - Scripting API: MonoBehaviour

The order in which they’re called is documented here: Unity - Manual: Order of execution for event functions

If none of those fit, then a good general solution is to use coroutines. To can start a coroutine in Start(). The coroutine can hang around until it’s time to do something. Then it can do something and end.

Your question is quite vague, but my first idea would be to use events.

You subscribe to a particular event in each script that is interested in it, then fire that event at appropriate times.

This is only available in C# as far as I know, though you can emulate it with a construct like in this answer.

An alternative to events is SendMessage. It uses reflection so it’s not a good idea to use it in Update or anything that runs frequently.

Start(), Awake(), Upadte(), etc. are function (you don’t write function within them).

They are functions that are called automatically at a certain order (decided by the “MonoBehavior”).

Any other functions you create (you can create any and as much as you want), needs to be called manually.

To call functions from one gameobject to the other, use GetComponent.

The most basic answer is: yes, you have to call your functions from within one of the MonoBehaviors for them to happen.