-
Count bounces of DVD logo
Hey guys,
I used the expression for the bouncing DVD logo i found here on CreativeCow.
I am trying now to add a counter that detects each collision.
I managed to detect a direction change for my logo, but I am failing at counting the detections without overwriting the added number.
My set-up looks like this:
a var switchDirection will look at the position of the logo and switch from 0 to 1 or 1 to 0 each time the direction changes.
A counter looks at that sswitch and compares the valueAtTime(time) and valueAtTime(time-1) to see if a change happened.
var sswitch = effect("Switch")("Kontrollkästchen"); if(sswitch.valueAtTime(time)==sswitch.valueAtTime(time-(1/25))){ value; } else { value+1 }My problem is now that instead of counting up, the counter is always is setBack to 0 one frame after the direction change.
I can see why my code doesnt work, but I cant figure out a way to bypass it.
Anyone any idea how to do it?
Thanks in advance.