Best way to have a single occuring event?

Say I want to make a button that when i press it the camera zooms out a certain distance and then stays in its new place, and when i press the button again, it zooms back to the original position (or just have another button for the zooming back in)

any ideas?

cheers

one way would be to use a count CHOP
akar.toe (2.56 KB)

cheers for that,

if I wanted to have the event occur once when the button was pressed but then return to its original, is that just as easy?
say i wanted the camera to change position when i click the button, but when it reaches its destination it reverts back to its original position?
thanks!, i dont know what i would do without this forum >_>

For a simple animation (like zoom), you can get away with just the trigger CHOP (but you’ll need to change the button mode on your button COMP to momentary).

If you wanna trigger multiple channels (or a predefined keyframe animation, …) then have the trigger create a 0-1 ramp of your desired length and feed this into a lookup CHOP. Then wire-connect your animation channels to the lookup’s second input.

ok thanks

well it is a simple animation, just a white flash (so a white constants alpha being increased and then decreased)

the point in this is during the white flashes peak, I want the texture to change say from texture A to texture B and stay on the next texture. and when the button is pressed again, for it to revert back to its original texture at the flashes peak.
op
so far ive got the button > Pannel Chop > Trigger Chop1 > Trigger Chop2

where Trigger Chop1 is animating the white flash, and trigger Chop2 has a slight delay on which it goes to 1 and then to 0 instantly,

is their a way of having a chop that will switch between two values every time it receives a specific number input? (in this case 1)
so trigger chop2 would essentially trigger another inbetween the numbers 1 and 0, which would effect the texture of an object?

many thanks

A count CHOP (set to increase on “offtoon” and loop min 0, max 1) should work, but you might need to increase the “Trigger Threshold”. Or you could set it to increase on “ontooff”.

Ok wicked thanks,

just one last question :smiley:

I would like the small animation to be affected by more than one button,
so their is a button for each texture, turning them on and off, but when ever i press any button i would like the small white flash to animate

at the moment i can only get one button to do this (going through a pannel chop) because their is only one input?

cheers

trigger 1 is controlling the flash. As you want to switch the texture once the flash peaks, I delayed the texture-switch channels by the attack length of the trigger CHOP.

Hope this helps
A
triggerSwitch.toe (4.15 KB)

There are probably 1000 ways to do this in TouchDesigner, but I like using a Math CHOP for this. Connect the two channels from both buttons into a Math CHOP, then on the OP parameter page set Combine CHOPs to Maximum (use Combine Channels if both channels are coming in on the same input).

A simple way to get output of 1 whenever any of the inputs go to 1.

cheers