J Doe
J Doe

Reputation: 415

Libgdx | What happens when Actor has 2 of the same actions added

What happens if I add moveTo to an actor twice, both with different positions? Will it finish the first one first, then move to the next? Or does it skip the first? Thanks

Upvotes: 0

Views: 28

Answers (1)

Tenfour04
Tenfour04

Reputation: 93581

They both continue normally, but since they're changing the same parameter, you'll only see the effect of the most recent one. But if the more recent one has a shorter duration than the old one, then when the more recent one is finished, you will see the values jump back to what they would be if the more recent one never happened.

So if you're adding similar actions with differing durations, you need to remove old ones first.

Upvotes: 1

Related Questions