Skip to main content

Search

How to have a hold button on a toggled animation

  • Xenareee

    My only idea is to have a timer for a short period of time (like 0.2 sec) that divides a press from hold.

    From this I mean detecting if the button is pressed or held, and after these 0.2 seconds going into standing/crouch mode or crawl mode, depending on the button being pressed after the timer finishes or not.

    I'm not sure what you need the signal manipulator for, but if it's purely for that logic, that's how it could work without it:

    ▪Wire the "button pressed" output into "start timer". Timer takes 0.2 secs to finish

    ▪Have an AND gate with "timer completed" and "button pressed" plugged in. This gate will activate when button is pressed for longer than 0.2 seconds.

    ▪Have a second AND gate which is exactly the same, but "button pressed" wire is plugged into the NOT gate first. (So, timer output and NOT gate output). This gate will activate when button is pressed only shortly, for less than 0.2 seconds.

    ▪Then use those to enter different animations.

    Of course, if 0.2 seconds is too little for a button press, feel free to try different times out.

    I hope such a solution will work! :) If timer resets in the same moment as the AND gate acrivates, this would need a bit more to work. I hope not, haha ^^

  • TAPgiles

    I made a tutorial on how you can do this with a timeline. https://www.youtube.com/watch?v=nRI75NPHgCQ

Please sign in to leave a comment.