Skip to main content
1y ago

How do you cancel an animation in the middle and transition back smoothly?

I'd like to cancel an animation if a boolean value changes and return to the previous animation smoothly. Currently my animation jumps to start of the animation.

10 replies
C
1y ago

HI Can you explain better what you are trying to do? Do you want to cancel an animation that is already running and want it to jump to another state?

1y ago

I have an animation where a truck starts up and pulls away, but I'd like for it to reverse (from it's current position) and back into place if the boolean is switched to false. So it would cancel the "truck leave" animation and go to a "truck return" animation. Does that make sense?

1y ago

Yes. The return animation, would the animation look backwards?

1y ago

Currently I created a separate timeline to reverse it but I'm ok with it reversing the "truck leave" timeline.

1y ago

It's something like this? I used a joystick for the animation and duration for the back transition.

C
1y ago

Following this thread as I am hoping to create something very similar. Great little vid explanation there and using the joysticks to keyframe the animation timeline. I recreated it which it all works nice.

The question I have though is how would you set it up so that it could be like Flappy Bird to have the truck stay in the white region without it having to go back to the very start pos? Wanting to hold and release the boolean with the pink button to see if I can have the truck stay within the white region. Thank u!

1y ago

You could do it this way. Using the same animation (Play) where the truck leaves the white square, and the same trigger for the two transitions with duration and an interpolation.

C
1y ago

Thank you JC! I will give this a try. Out of interest, are there any examples you know of in the community of a flappy bird type concept? Mainly using a boolean if held down, an item floats up...and if released, item sinks. Jetpack Joyride...or a submarine travelling along underwater?

1y ago

That's exactly what I'm looking for, though I'm not clear on how using a joystick (I've never used one before) helps solve that.

1y ago

Yep. This is a small video about how you can configure the joystick for this example. Also this is a creative session where you can see how works with joysticks and the 101 about Joysticks, and the demo file.

joystick_demo.rev
4 KB