Problem tweening 'global_position' after setting Scale and PivotOffset

Godot Version

v4.2.stable.mono.official [46dc27791]

I’m trying to use a tween to scale and move a control (TextureButton) but the final position is incorrect if Scale is not 1 when PivotOffset is not 0.

This code correctly positions the control at (0,0):

ctrl.PivotOffset = new Vector2(64f, 64f);
tween.TweenProperty(ctrl, "scale", new Vector2(1.0f, 1.0f), 1.0f);
tween.TweenProperty(ctrl, "global_position", Vector2.Zero, 1.0f);

Changing the scale from 1.0 to 0.9 incorrectly positions the control at (6.4000015, 6.4000015):

ctrl.PivotOffset = new Vector2(64f, 64f);
tween.TweenProperty(ctrl, "scale", new Vector2(0.9f, 0.9f), 1.0f);
tween.TweenProperty(ctrl, "global_position", Vector2.Zero, 1.0f);

Same code but with the PivotOffset now set to (0,0) works correctly again:

ctrl.PivotOffset = new Vector2(0f, 0f);
tween.TweenProperty(ctrl, "scale", new Vector2(0.9f, 0.9f), 1.0f);
tween.TweenProperty(ctrl, "global_position", Vector2.Zero, 1.0f);

Any ideas why this might be happening and how I can fix it?

I have facing exactly same this problem, have anyone found solution about this?

For me, just tried to bump down these button from invisible (as shown as darker texts) button’s relative position from global position and this happened.

I know the solution, I have recently (yesterday) added this feature in my game. I will mention the solution after 2 hrs.

Do you want like that?

I’m pretty new and I was having the same issue with a card dragging scene that scaled on hover. I had centered the pivot point to the center of the card thinking that determined the orgin of the position and the card would go crazy when I tried to drag while scaled. To solve it I aligned the PIVOT point and ANCOR point to the same location.