Search Unity

Bolt Help: Delayed Input

Discussion in 'Visual Scripting' started by zapman502_unity, Aug 24, 2020.

  1. zapman502_unity

    zapman502_unity

    Joined:
    Jul 13, 2020
    Posts:
    4
    So I am trying out a simple Jump graph but it has some weird Input lag. Sometimes when I press the button it works, other times it just doesn't see the input. I attached a screenshot of the bolt graph I made incase something I did there is causing the seemingly random input reading. Is it just performance issues with bolt?
     

    Attached Files:

    • bolt.PNG
      bolt.PNG
      File size:
      52.5 KB
      Views:
      394
  2. Ex-Crow

    Ex-Crow

    Joined:
    Aug 14, 2020
    Posts:
    111
    Your issue is the use of Fixed Update. Input detection should always happen in Update.
     
    vinurd and zapman502_unity like this.
  3. guybro_thunderboots

    guybro_thunderboots

    Joined:
    Aug 27, 2015
    Posts:
    45
    FixedUpdate isn't guaranteed to run as frequently as Update, so that's probably why. You'll want to use another way of detecting inputs.

    Conveniently, there's a short Unity tutorial that handles jumping inputs here that you might want to watch:
     
    vinurd and zapman502_unity like this.
  4. zapman502_unity

    zapman502_unity

    Joined:
    Jul 13, 2020
    Posts:
    4
    Thank you both Ex-Crow and guybro_thunderboots for your replies! I will use a regular update for input detection then. The video is also very helpful, thanks.
     
  5. yelparetwo

    yelparetwo

    Joined:
    Jun 4, 2021
    Posts:
    1
    A simple delay unit should be added to delay execution by a certain amount of seconds.
    Implementation details are important here. The delayed code will probably run in a coroutine, but nested coroutines or delayed loops will not be supported, as they add a lot of complexity to the flow. https://jiofilocalhtml.run https://forpc.onl/
     
    Last edited: Jun 5, 2021