Frames that only play on a certain condition

I’m trying to animate a moving clip and I want to make certain frames only play when I press < or > down. And I haven’t found any way to do this. Either make a command for this or give me some code that can help me create what I want

Hi @Cleetus_Kernel,

there is code available to read keypresses, and code to jump to a certain frame. Both are in the tutorials. Is there a reason this does not fit your needs?

regards,

Paul

To play a clip you’d need to write this code:

if(isKeyDown(‘space’)){
this.play();
}

Swap the bolded words to fit your needs - this should be swapped with the name of the clip, while the whole keyDown function could be changed - for example, just go to the mouseclick function of the clip itself and type in - this.play();

hope that helped!

when I try holding down >, it stays stuck on one frame and doesn’t move on.

@Cleetus_Kernel would it be ok to send a copy of what that looks like as a .wick file? I might be able to find the problem and re-code it

I fixed some parts thanks to you(Thanks!) but there one more problem. The character will do its clip animation but not the keyboard controls.
My Project5-21-2020_10-46-47AM.wick (57.1 KB)

I fixed your project, you could change the animation and play around with the code, here it is:
project fixed.wick (57.3 KB)

Hope its what you needed

It’s exactly what I need! Thanks you very much! Honestly, I can never thank you enough for this! In a few weeks I will finish enough to the point that it can have beta testing! Would you like to try it out one day?

1 Like

That’s good to hear, i’d love to try it out one day!

I’m sure it’ll end up great

There might be a delay due to the walls and character malfunctioning.

That’s ok, but if you’ll need
help with anything, just let
us know! :+1: