Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to use an IF node for a bool toggle?

Discussion in 'Visual Scripting' started by DigitalAdam, May 20, 2021.

  1. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,201
    How do I setup a boolean toggle? I'm using Unity's new input system with a crouch button, and I'd like to alternate true and false every time the button get pressed. Here is what I have so far. It works when I press the button, but I can't figure out how to set it to false on the next key press. Any thoughts would be appreciated.

    Setup.jpg
     
  2. tigme

    tigme

    Joined:
    Jul 1, 2014
    Posts:
    37
    upload_2021-5-20_20-32-18.png
    Some like the above with a Toggle value?
     
    GregMcM likes this.
  3. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,201
    Exacty what I needed... thanks!!
     
    tigme likes this.