# Main Unity Events

### Description

This collection of [OverNode](/over-sdk-manual/over-visual-scripting-legacy/visual-scripting-essentials/overnode.md)s is used to describe the main flow of the [OverGraph](/over-sdk-manual/over-visual-scripting-legacy/visual-scripting-essentials/overgraph.md). The following nodes are directly connected to the Unity3D Monobehaviour of the [OverScript](/over-sdk-manual/over-visual-scripting-legacy/visual-scripting-essentials/overscript.md), to which the Graph refers.

#### Awake

Awake is called once when the script instance is being loaded – exactly once in the lifetime of the script.&#x20;

It is commonly used to describe the logic that should be executed before the first frame is played, acting as a general initialization stage of the script.

<figure><img src="/files/PRdvJIIuGdoIHHNrFCEb" alt=""><figcaption></figcaption></figure>

#### Start

Start is called once on the frame when a script is enabled just before any of the Update methods are called the first time.&#x20;

However, Awake is called when the script object is initialized, regardless of whether or not the script is enabled.

It is commonly used to describe the logic that should be executed on the first frame, acting as a general initialization stage of the script.

<figure><img src="/files/OxByY3pQGUc51kXhgqch" alt=""><figcaption></figcaption></figure>

#### OnEnable

This function is called when the object becomes enabled and active.

<figure><img src="/files/GT62s9fvbqdGMQYM25eY" alt=""><figcaption></figcaption></figure>

#### OnDisable

This function is called when the object becomes disabled.

This is also called when the object is destroyed and can be used for any cleanup code. When scripts are reloaded after compilation has finished, OnDisable will be called, followed by an OnEnable after the script has been loaded.

<figure><img src="/files/jdVqMbsTCvbHHkw9EnCR" alt=""><figcaption></figcaption></figure>

#### OnDestroy

This function is called when the object is destroyed.

This also occurs when a Scene or game ends. Called always after OnDisable.

<figure><img src="/files/U1KpSEDAdaOWPwK8DRit" alt=""><figcaption></figcaption></figure>

#### Update

If the script is active and enabled, Update is called every frame, once per frame.

It is the most commonly used function to implement any kind of game script, allowing the implementation of logic to be executed at runtime.

<figure><img src="/files/fH5sVDDcOf0bw0Zdd0w8" alt=""><figcaption></figcaption></figure>

#### LateUpdate

Like Update, also LateUpdate is executed once per frame, but after all the nodes in Update have finished executing.

This is useful to give the execution flow and order. It is commonly used to handle animations and camera movements, because it tracks objects that might have moved inside Update.

<figure><img src="/files/4JjXdIGSZB1XhEqMYUQ3" alt=""><figcaption></figcaption></figure>

#### FixedUpdate

Similar to Update, FixedUpdate is a frame-rate independent node, called repeatedly based on a fixed frequency, given by the Unity3D Physics system.

This is crucial to handle calculations featuring Rigidbodies and Collisions.

<figure><img src="/files/LSJcZfeenWw80EKxQMOu" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.overthereality.ai/over-sdk-manual/over-visual-scripting-legacy/nodes/flow/main-unity-events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
