Can a join be used to join to a join?
« on: October 07, 2015, 01:06:39 AM »
Hi there

Random question: Is it possible to use .Join on another .Join? I have a few events in a sequence that all need to fire at the same time, so I added a few tweens like this:

Code: [Select]
Sequence mySequence = DOTween.Sequence();
mySequence.Append(*something*);
mySequence.Join(*something joined*);
mySequence.Join(*something else joined*);
mySequence.Join(*something else joined*);

In the example I could obviously just use Insert(0), but poor examples aside: Is it possible to do this? I was experimenting in a project and getting some odd results when restarting the tween, like as if it was running them all sometimes but skipping over them others.

If this is perfectly valid then I'll go back and just check my tweens are working correctly, but if this is a known no-no then figured I'd ask  :)

Cheers!

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: Can a join be used to join to a join?
« Reply #1 on: October 07, 2015, 01:20:54 AM »
Hi,

Absolutely yes, I use multiple Joins all the time :)

Cheers,
Daniele

Re: Can a join be used to join to a join?
« Reply #2 on: October 07, 2015, 01:34:41 AM »
Very good!

I'll see if I can recreate my tween in a blank project. If I replace everything with Inserts it works fine, but with Joins it seems to go out of sync sometimes. But I have a lot of stuff running so maybe it's just my project.

Thanks for the quick response :)

Edit: Turns out the issue was that a sequence was still running while another sequence kicked in on the same sprite. I thought that if a sprite is already being tweened when a new one starts that DOTween just overwrites the current one. Looks like you have to call Complete() on your tweens first to make sure they don't overlap. I think the reason the Insert worked but the Join didn't was that Join was adding a few extra milliseconds to the tween which was enough to cause the sequence overlap.
« Last Edit: October 07, 2015, 04:20:45 PM by boolean0101 »