godotengine / godotengine/godot
Using Tween on `global_position` and `scale` at the same time results in a completely different scale center
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
v4.3.stable.steam [77dcf97d8]
### System information
Godot v4.3.stable (77dcf97d8) - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 (NVIDIA; 32.0.15.6094) - AMD Ryzen 5 5600X 6-Core Processor (12 Threads)
### Issue description
After modifying the pivot offset property of the Control node, theoretically, scaling should expand with the new pivot offset as the center. However, if Tween is used to modify both `global_position` and `scale` simultaneously, the `pivot_offset` is then scaled using the `(0,0)` point.
As a result, modifying `global_position` and `scale` simultaneously with Tween will behave completely differently from modifying `position` and `scale` simultaneously with Tween.
Should this be considered a bug?
### Steps to reproduce
First, change the `pivot_offset` of the `Control` node to something other than `(0,0)`
```
func go_to_global_position_and_scale() -> void:
var tween_move_and_scale = create_tween().set_parallel()
tween_move_and_scale.tween_property(self, "global_position", global_position + Vector2(1, 1), 0.5)
tween_move_and_scale.tween_property(self, "scale", Vector2(2, 2), 0.5)
func go_to_position_and_scale() -> void:
var tween_move_and_scale = create_tween().set_parallel()
tween_move_and_scale.tween_property(self, "position", position+ Vector2(1, 1), 0.5)
tween_move_and_scale.tween_property(self, "scale", Vector2(2, 2), 0.5)
```
Copy two Control nodes and try to execute the above code, result

### Minimal reproduction project (MRP)
[scale_bug_mini_reproduction.zip](https://github.com/user-attachments/files/18455874/scale_bug_mini_reproduction.zip)
Contributor guide
Research direction
Start with the attached scale_bug_mini_reproduction.zip and compare the two Control nodes using parallel Tweens on global_position and scale versus position and scale. Read the Control node's pivot_offset, position, global_position, scale, and Tween behavior, then verify the result against the reported difference in scale center.
Written by the indexing model from the issue text.
Assessment
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100