Unity uses the word “On” a lot in its function like: OnTriggerEnter, OnCollisionEnter, OnDrawGUI, OnDrawScene, OnDrawInspector, and more.
It’s sounds good to add the word “On” in my own functions like: OnEndLevel, OnStartLevel, OnArrowFire, OnJump.
Is it a good habit or bad habit to use it like that?
It’s a good habit and helps understand what functions do, just make sure you aren’t overlapping unity functions and that you actually call the function. Unitys On functions are automatically called.
Functions that begin with On are generally event-triggered function calls, used as a reaction or callback to an event that occurred.
1 Like