Search Unity

Question Checking a GameObject for its current State in Visual Scripting

Discussion in 'Visual Scripting' started by literacy, Oct 3, 2022.

  1. literacy

    literacy

    Joined:
    Nov 14, 2021
    Posts:
    56
    I have a State Machine in Visual Scripting with 2 states: BASIC and PLACED.

    Is there a node I can use to check a GameObject for its current State?

    I can create an Object Variable and track the state that way... just wondering if there's a built-in way to achieve the same!
     
  2. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,063
    Since you can nest states into other states infinitely, there's no built in system for detecting current active state. And multiple states can be marked as Start states simultaneously so two or more states can be active on the same level as well.

    So you have to handle it yourself via Object variables as you mentioned or other similar solutions.
     
    ericb_unity and REDACT3D_ like this.