1. #1

    One Button Press Animation (without holding button down)

    Hello all,

    I was working on the basics of a skill game earlier and I ran into some trouble figuring out how to make an animation fully run through its course by just tapping the specified button connected to it (RT). The animation will run smoothly when I hold down the button (as I have it set to activate "On Press") but I want the animation to just run through by itself after tapping the button so the user can quickly re do the animation after it is completed by pressing the same button.

    I am sure this is probably a pretty basic answer but I seem to be stuck at the moment. Any help would be appreciated.

    Thanks,

    rjn4
    Share this post

  2. #2
    Well, on press is supposed to only send 1 impulse, whether the button is held or not. On down will continue to fire impulses for as long as you press the button. Do you have on down set as well? Because that's what it sounds like.

    Anyway, you could also disable the RT after it sends it's impulse to start the animation, then re enable RT when it's finished.
    Share this post

  3. #3
    point the button on press to a state event

    place an interval trigger(in1tick, enabled unchecked) to replace the button you had earlier
    now link the state event (on) to the interval trigger

    now the state event will activate the interval trigger when the button is pressed and it will work till you disable it
    Share this post

  4. #4
    Thanks, the interval trigger connected to the button worked for me. Now I am wondering how I can disable the button that runs the animation so it cant be used over and over in quick succession before the anim actually finishes. Any way I could get some help with that too? It is basically like limiting the animation to a single jump each time it runs through. Thanks!
    Share this post

  5. #5
    u can use state events(off) to stop things from working
    Share this post

  6. #6
    After the button, before the State ON event, connect an 'Impulse Clamp' (I think it's called, but definitely uses Clamp); it's in the same list as the Impulse Delay. The Clamp will allow you to limit the number of signals passing through it. Set it to min=1 and max=1, and set the delay to the length of the animation, or time that you don't want the button to work.

    So now you may have this:

    Button (Press) > Clamp > (Signal splitter)
    PATH A: State ON > Interval Trigger > Animation
    PATH B: Impulse Delay (set to animation length) > State OFF > Interval Trigger
    Share this post

  7. #7
    Originally Posted by MikeMcCall Go to original post
    After the button, before the State ON event, connect an 'Impulse Clamp' (I think it's called, but definitely uses Clamp); it's in the same list as the Impulse Delay. The Clamp will allow you to limit the number of signals passing through it. Set it to min=1 and max=1, and set the delay to the length of the animation, or time that you don't want the button to work.

    So now you may have this:

    Button (Press) > Clamp > (Signal splitter)
    PATH A: State ON > Interval Trigger > Animation
    PATH B: Impulse Delay (set to animation length) > State OFF > Interval Trigger
    you don't really need clamp nor the splitter

    you can do button->state event(on(for interval trigger that starts animation))->state event (off(disables button))
    and at the end of the animation you can put a state event that enables button again if needed

    i've never seen a use for the clamp
    Share this post

  8. #8
    dasraizer's Avatar Senior Member
    Join Date
    Apr 2014
    Location
    UK, Isle of Wight
    Posts
    1,195
    def no need for splitter.

    i'd just
    OnPress->state event toggle that points to your animation interval and any curved data sources.

    or if you need to reset the animation when stopped

    OnPress->check some variable equals 0, if true then state event on the interval and set the variable to 1
    if its false (ie the variable is 1) then reset the animation and set the variable back to 0 ready for the next press. make sure curved data/OPE etc have there respective reset on enable/disable checked, so when disabled/enabled they restart correctly.


    EDIT: infact if you just set the reset on enable/disable options in each trigger all you should need is to toggle the relevant items, curves, ope etc.
    Share this post