Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Resolved cannot assign enum value to set variable node

Discussion in 'Visual Scripting' started by nekowei, Oct 13, 2022.

  1. nekowei

    nekowei

    Joined:
    Aug 4, 2018
    Posts:
    2
    Hi I'm using unity 2021.3 visual scripting 1.7.8
    When I set variable in the blackborad, I can find my ActionState enum class.
    But then I want to use the Set Variable node to assign a value to the enum variable, I can't find my ActionState enum class.
    Is there any step I'm doing wrong or there's some node setting I'm missing?
     

    Attached Files:

  2. munchmo

    munchmo

    Joined:
    May 20, 2019
    Posts:
    82
    Have you made sure to include the class in visual scripting section of the project settings then regenerate nodes?
     
  3. nekowei

    nekowei

    Joined:
    Aug 4, 2018
    Posts:
    2
    Thanks for reply! Didn't realise that enum is a kind of type ;(

    I add the enum type into [project settings -> Type Options], it works now!

    also [Regenerate Nodes] is required, only add the type won't work
     
    Last edited: Oct 19, 2022
    REDACT3D_ likes this.