> For the complete documentation index, see [llms.txt](https://kdoore.gitbook.io/cs2335/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kdoore.gitbook.io/cs2335/overview-branchlogic/script-executionorder.md).

# Script ExecutionOrder

The image below shows that the Execution Order can be set scripts if there's a dependency relationship such that the script's order of execution impacts the scene logic.

The **EndSceneConsequences** are shown as having its' logic executed before the default time when other scripts have their code executed.  This is because the data for the **CatState and MonsterState** are configured in this script, so the **NPCActivation** must be executed after this script so those gameObject's visibility is determined at the beginning of the scene.

Hide\_Show\_Panel executed before DialogManager, because logic has been added to **DialogManager version2** to open the finalPanelToOpen if there are no conversations left to be executed.

To **Set the Script Execution** Order, Select the **Hide\_Show Panel** Script in your assets, then in the Inspector, select the option at the top: **ExecutionOrder.**  When you have the ScriptExecution Order open in the ProjectSettings, Drag the **Hide\_Show\_Panel script and the DialogManager scripts into the  panel** and make sure that the Hide\_Show\_Panel script gets executed first....so that the logic in the DialogManager...to show the LastPanelToShow is executed last.

![](https://3353821304-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0-KLgOacVpbicrqehO%2F-MN9utEhE7uxkMwdjSM0%2F-MN9v9J6avT7PHHID8eF%2FScreen%20Shot%202020-11-27%20at%2012.16.00%20PM.png?alt=media\&token=31ff19bf-a989-408f-84a0-85d7dba239df)

![](https://3353821304-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0-KLgOacVpbicrqehO%2F-MM7jM0-kvD7YCg7zzk4%2F-MM7kEzqwdDwsemio6Gw%2FScreen%20Shot%202020-11-14%20at%203.54.00%20PM.png?alt=media\&token=97029976-817b-425b-9fc3-9d80c1d8e831)
