I need some help understanding order of events

I have 4 cubes in a line. each could rotate forward or backwards 15 degrees. each one will rotate (or not), and then try to butt themselves up to the previous one in line, this happens to each, one at a time. when I am simply using transform.position and transform.RotateAround for both the rotation and repositioning, its flawless.
Now I am trying to introduce tweening (Specifically DOTween) but right now, DOTween does not have a RotateAround method, so that is staying a transform.RotateAround, but I have changed the butt-up method to DOMove. But the cubes don’t line up anymore. I think because the tween hasn’t finished by the time the transform.position is firing, so it’s butting up to the previous vector3 location of the cube pre-rotation. And as you go down the chain, it gets worse. I am hoping that a DOTween.RotateAround method is forthcoming, but I am wondering even if I turn this into a sequence, won’t I still have location issues? does the code run first, and gather x,y,zs and the only thing that is sequenced is the movements? I I realize this part of the question is based on a method that doesn’t exist, but I’m trying to wrap my head around it. I need to have a chain of movements, but I won’t have those locations until after the movements complete. Or do I have to get those vector3s up front and store them for when I try to set up the tween sequence?

I think you can put the transform.RotateAround in the tween sequene.

something like this, IIRC

Sequence mySequence = DOTween.Sequence();

mySequence.Insert(1, () => { transform.RotateAround(); }, tweenTime);

thanks, I will give this a whirl!

Hey there, it seems that both Insert and Append want objects of type Tween, I appreciate the suggestion. I am open to any others! I event tried to cast it as Tween, but it still didn’t like it.

Hey, I think I figured it out. You can use anonymous lambdas in the Callback() and AppendCallback() methods. Experimenting now.

OK, I’ve got this to work, and I think my original theory is correct, I used a chain of AppendCallback()s so that the calculations would be using the current value of the cubes positions. I also added some SetEase()s to give it a mechanical look. Works great!