# Urgent Bug Fix

**Note: This is only necessary for Skill Tree Systems created before October 20, 2024.**

#### Fix for Bug in AC\_SkillTreeSystem

An issue has been identified where having certain functions and variables within the `AC_SkillTreeSystem` leads to unexpected behavior. To fix this, follow these steps:

1. **Remove the `CreateTemplateSkillTreeWidget` function** from the `Begin Play` event in the `AC_SkillTreeSystem`.

   <figure><img src="https://644676383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlAiliYSjiUCcPswEtNNW%2Fuploads%2Ffn634e1KFz27N32jr0h7%2FDeleteBP.png?alt=media&#x26;token=fe9f6aff-a4df-401d-95ba-ba1aba9e300e" alt=""><figcaption></figcaption></figure>

2. Decide where you would prefer to relocate these functions and variables in your game. They can be moved to either the **Player Controller**, **Game Instance**, or **Game Mode**.
   * For this example, we’ll move them to the **Player Controller**. The functions and variables that need to be moved are:

     * `CreateTemplateSkillTreeWidget` (function)
     * `ToggleTemplateSkillTreeUI` (function)
     * `SkillTreeWidget` (variable)\\

     <figure><img src="https://644676383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlAiliYSjiUCcPswEtNNW%2Fuploads%2FtoJ7kwrkmpRN2vSbeT3H%2FTransferVarFun.png?alt=media&#x26;token=7d090f0b-9b08-4700-8075-74e9e0830b3c" alt=""><figcaption></figcaption></figure>

3. If the `CreateTemplateSkillTreeWidget` function was used in the `Begin Play` event of the `AC_SkillTreeSystem`, make sure to add it in the `Begin Play` event of the new location (Player Controller in this case).\\

   <figure><img src="https://644676383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlAiliYSjiUCcPswEtNNW%2Fuploads%2F0AZvznmy47hTQqt1EN5W%2FAddCreate.png?alt=media&#x26;token=fc64b8e6-3462-4152-8055-8dfde5aae377" alt=""><figcaption></figcaption></figure>

4. After successfully moving the functions and variable, **delete** them from the `AC_SkillTreeSystem`.\\

   <figure><img src="https://644676383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlAiliYSjiUCcPswEtNNW%2Fuploads%2FJDPrXrPv8mzw6RTfC5De%2FDelete.png?alt=media&#x26;token=792de671-07c0-4ed3-91ba-e1e1a656762e" alt=""><figcaption></figcaption></figure>

5. Lastly, search for any references to these functions and variable, and **replace** them with the new references\*\* based on their updated location.\
   \\

   <figure><img src="https://644676383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlAiliYSjiUCcPswEtNNW%2Fuploads%2FXWj67WYyUEfFGOP21930%2FReplace.png?alt=media&#x26;token=472610fc-a930-4f5c-85c4-a63b15a1c462" alt=""><figcaption></figcaption></figure>
