PDA

View Full Version : One Button Press Animation (without holding button down)



rjn15
05-17-2014, 02:03 AM
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

stllbreathnbdy
05-17-2014, 06:42 AM
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.

SparkierJoNESZ
05-17-2014, 08:43 AM
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

rjn15
05-17-2014, 06:51 PM
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!

SparkierJoNESZ
05-17-2014, 07:34 PM
u can use state events(off) to stop things from working

MikeMcCall
05-19-2014, 11:25 AM
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

SparkierJoNESZ
05-19-2014, 01:45 PM
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

dasraizer
05-20-2014, 05:29 PM
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.