Awake() method in a MonoBehaviour?Awake() is called when the script instance is being loaded. It is used to initialize variables or states before the game starts. It runs even if the script component is disabled.
Start() method called in the MonoBehaviour lifecycle?Start() is called before the first frame update, but only if the script component is enabled. It is used to set up things that depend on other objects being initialized.
Update() and FixedUpdate()?Update() runs once per frame and is used for regular frame-based logic like input checking. FixedUpdate() runs at fixed time intervals and is used for physics calculations.
OnEnable() method do in the MonoBehaviour lifecycle?OnEnable() is called every time the script component is enabled or the GameObject it is attached to becomes active. It is useful for subscribing to events or resetting states.
OnDestroy() in MonoBehaviour.OnDestroy() is called when the MonoBehaviour will be destroyed. It is used to clean up resources, unsubscribe from events, or save data before the object is removed.
Awake() is called once when the script instance is loaded, before any other method.
FixedUpdate() runs at fixed intervals and is designed for physics calculations.
Start() called in the MonoBehaviour lifecycle?Start() runs once before the first frame update, but only if the script is enabled.
OnEnable() is called?OnEnable() is called when the script or GameObject becomes active.
OnDestroy() is called before the object is destroyed and is used for cleanup.
FixedUpdate() instead of Update().