Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Enable and disable object components in Bolt?

Discussion in 'Visual Scripting' started by MathiasAlgot, Nov 18, 2020.

  1. MathiasAlgot


    Sep 30, 2020
    I've been testing out the A* navigation system and it uses a script for targeting the player and a different script for patrolling.
    Basically, I want to disable the Patrol script and enable the targeting script.
    However, I can't find any way to do this.
    I've tried searching the script name in the fuzzy finder and adding the script as a variable. I also can't find a way to add the scripts under the "Bolt Types" tab.
    Any help is greatly appreciated
  2. Ex-Crow


    Aug 14, 2020
    Go to Tools/Bolt/Unit Options Wizard.

    It has two tabs that you can switch between if you scroll down at the bottom.

    The first tab is Assemblies - for DLLs.

    The second tab is Types - for scripts.

    If scripts don't come up in the Types tab, it could be that they are compiled in DLLs and need to be added in Assemblies first, which will expose the DLL contents - the scripts to the second Types tab.

    If you still can't find the necessary types after doing the above, however, it could be that Bolt considers some script contents to be AOT unsafe, meaning they wouldn't run on AOT platforms if included in graphs/variables. Bolt by default filters out AOT unsafe results. You can go to Bolt's preferences and disable AOT safe mode to see if this is the case. Sometimes only a small part of the code base is AOT unsafe, so it can still be safe to disable the safe mode, add the type, regenerate units and then enable AOT safe mode again. It will then filter out the unsafe search results, but it will keep the rest of it.
    Last edited: Nov 19, 2020
    Haneferd likes this.