Search code examples
javaandroidlibgdxbox2dscene2d

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


Solution

  • 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.