Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to disable Bolt flow macros

Discussion in 'Visual Scripting' started by craftgaming0811, Jan 27, 2021.

  1. craftgaming0811

    craftgaming0811

    Joined:
    Oct 18, 2020
    Posts:
    5
    I have just made a quick game in bolt which was originally made in c#. I have written this code to detect when the player has hit a block. If it hits a block it will stop the player movement script and call the end game event inside my game manager which i have also recreated in bolt,
    Code (CSharp):
    1. public PlayerMovement movement;     // A reference to our PlayerMovement script
    2.  
    3.     void OnCollisionEnter(Collision collisionInfo)
    4.     {
    5.         // check if the object we collided with has a tag called "Obstacle".
    6.         if (collisionInfo.collider.tag == "Obstacle")
    7.         {
    8.             movement.enabled = false;   // Disable the players movement.
    9.             FindObjectOfType<GameManager>().EndGame();
    10.            
    11.         }
    12.     }
    There doesnt seem to be a way to disable flow macros however, there is a way to disable flow machines but I cant seem to set the flow machine to disabled

    Am I doing something wrong or is there a better way of doing this?
     
  2. HoniGames

    HoniGames

    Joined:
    Aug 2, 2012
    Posts:
    23
    I don't understand if you want to disable the macro from that script or from inside bolt.
    In case you mean to do it from inside bolt:
    if you use for example "flow machine set enable", it will turn off or turn on the first flow of the target object...
    to refer to a certain one you must either put that flow in a variable or get a list of all the flows with "get components" and know the order of the flows in the target object to refer to it through the index.
     
    craftgaming0811 likes this.
  3. brian1gramm1

    brian1gramm1

    Joined:
    Sep 15, 2017
    Posts:
    56
    In my fuzzy finder there is no option for "Flow machine set enable".
     
  4. brian1gramm1

    brian1gramm1

    Joined:
    Sep 15, 2017
    Posts:
    56
    SOLVED! For anyone that has the same issue I had. GOTO->ProjectSetting->VisualScripting->TypeOptions->AddNewType->Search "Script Machine" then click regenerate nodes.
    I am not sure why my version failed to load this, but it solved my problem.