Conditionals?

FlowCanvas Forums Support Conditionals?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2976
    blabz2007
    Participant

    I can’t seem to find it in the documentation but how do I represent conditions in FlowCanvas?

    I’m looking to –

    • Execute a GameObject method if the GameObject is not null
    • Check that a property is a specific enum

    Thanks!

    #2977
    emre2345
    Participant

    You might use

    – IsValid node

    – Switch Enum node

    #2978
    blabz2007
    Participant

    Switch Enum works!

    The problem with the IsValid node is that it’s not a Flow Node.

    In the picture below, the GameObject the Notification Component is attached to may or may not exist. Destroy is a public method on Notification. I need to make sure Notification is not null before FlowCanvas attempts to call Destroy on it.

    I guess the alternative would be to make the Destroy method static and do the null check there, but I feel like FlowCanvas must be able to handle for this some way.

    Attachments:
    You must be logged in to view attached files.
    #2980
    emre2345
    Participant

    Hey,

    You should use IsValid with a Switch Condition node. Is valid outputs a bool which you then switch it accordingly with the Switch Condition.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.