How to getComponent from custom node.

Hi,
I’ve searched the docs and the forums and cannot figure out how to do this. I’m creating a custom node. I just want to get a component of the gameobject that the graph is connected to.

Looking for something like This.GetComponent().myVariable;

 protected override void Definition()
        {
            startState = ControlInput("start", OnStart);
            updateState = ControlInput("update", OnUpdate);
            exitState = ControlInput("exit", OnExit);

            startStateFinished = ControlOutput("Start Finished");
                        isStateFinished = ValueOutput<bool>("IsStateFinished", (flow) => isStateFinishedValue);
            onStateUpdate = ControlOutput("On Update");
            exitStateFinished = ControlOutput("Exit Finished");
        }

        protected virtual ControlOutput OnStart(Flow flow)
        {
            //GET COMPONENT HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            isStateFinishedValue = false;
            return startStateFinished;
        }

flow.stack.self :slight_smile:

1 Like

Thanks! looked forever could not find that.

1 Like