Search Unity

How to reference flow motion in C# script?

Discussion in 'Visual Scripting' started by ygh-jk, Oct 13, 2020.

  1. ygh-jk

    ygh-jk

    Joined:
    May 1, 2016
    Posts:
    6
    I'm not sure if this is the right place to post but what I'm trying to do is enable/disable the bolt component of a game object but I'm not sure how to do that in C#?
     
  2. Ex-Crow

    Ex-Crow

    Joined:
    Aug 14, 2020
    Posts:
    111
    Should work like any other component.

    Code (CSharp):
    1. var flowMachine = GetComponent<FlowMachine>();
    2. flowMachine.enabled = false;
     
    ygh-jk likes this.
  3. ygh-jk

    ygh-jk

    Joined:
    May 1, 2016
    Posts:
    6
    Yeah, that worked. Should've realized it when the component on the object is literally called Script lol. Thanks man!