Search Unity

Question Getting the StateMachine that runs the Unit

Discussion in 'Visual Scripting' started by Songh0318, Sep 4, 2021.

  1. Songh0318

    Songh0318

    Joined:
    Nov 29, 2016
    Posts:
    6
    How do I get the StateMachine component that is running the custom unit from code?

    I don't want to link up a This unit. I am using the visual scripting tool only as a graph editor to allow modularization of different RPG ability steps. Essentially, I am only connecting the enterstate and exitstate to a custom unit and let the code handle everything. Hence I need to be able to do that in a custom unit.

    I see the implementation of the This unit does what I want. But I don't have access to the source code.
     
    Last edited: Sep 4, 2021