Search Unity

Question How to stop wait seconds.

Discussion in 'Getting Started' started by TheKrazyDev, Mar 7, 2022.

  1. TheKrazyDev

    TheKrazyDev

    Joined:
    Sep 8, 2021
    Posts:
    107
    Ok so I need help(Just a warning I'm using visual scripting bolt ).
    So I'm making a fps with sliding and if you slide for 1 second you stand up, or if you let go of shift you stop sliding.

    So right now it sets a var called slide to 1(true) waits 1 second then changes to 0 (false), but i need it so if you let go of shift it cancels that wait second until next time you hold shift. If you could just give me a general idea of what I need to do would be awesome.

    The problem is that when I let go of shift and press it again it doesn't work until that wait seconds finishes from that last time it was called
    cancel wait seconds.png
     
  2. TheKrazyDev

    TheKrazyDev

    Joined:
    Sep 8, 2021
    Posts:
    107
    Also I know my update needs to be in a couritine to use wait. I just threw this example together and forgot that.