Run animations on the same object in sequence

30 Views Asked by At

I am trying to run sequences of animations for different objects at the same time.

This the part of the code that is causing me problems:

group = VGroup(*tasks)
animations = [
    group.animate.shift(RIGHT),
    group.animate.shift(RIGHT),
    group.animate.shift(RIGHT)
]

self.play(*animations)

It shifts all elements right once in one animation and ends. What am I missing here?

1

There are 1 best solutions below

0
CodingWithMagga On

As far as I know, is running multiple animations using the animate property in a single play()-function call not possible. A simple solution could be this:

group = VGroup(*tasks)
self.play(group.animate.shift(RIGHT))
self.play(group.animate.shift(RIGHT))
self.play(group.animate.shift(RIGHT))

You could also run these animations simultaneously, like this:

self.play(group.animate.shift(RIGHT).shift(UP).set_color(BLUE))