godot icon indicating copy to clipboard operation
godot copied to clipboard

Issue with global_position while tween and pivot offset is set with certain values

Open CrankyUnicorn opened this issue 1 year ago • 1 comments

Tested versions

Godot 4.2.1

System information

Win 11

Issue description

Issue with tween weird behavior: it keeps moving the square further and further away from the center of the screen

extends ColorRect
var tween:Tween

func _ready():
    self.pivot_offset = (self.size / 2)
    
    tween = create_tween().set_parallel(true)
    tween.tween_property(self, "rotation_degrees", 15.0, 0.6)
    # tween.tween_property(self, "scale", Vector2(1.05f, 1.05f), 0.6) # also with this

func _process(delta):
    self.global_position = self.global_position

Diminishing the pivot_offset to zero mitigates the issue

Steps to reproduce

single scene with squares colorRect with this script on it

extends ColorRect
var tween:Tween

func _ready():
    self.pivot_offset = (self.size / 2)
    
    tween = create_tween().set_parallel(true)
    tween.tween_property(self, "rotation_degrees", 15.0, 0.6)
    # tween.tween_property(self, "scale", Vector2(1.05f, 1.05f), 0.6) # also with this

func _process(delta):
    self.global_position = self.global_position

Minimal reproduction project (MRP)

extends ColorRect
var tween:Tween

func _ready():
    self.pivot_offset = (self.size / 2)
    
    tween = create_tween().set_parallel(true)
    tween.tween_property(self, "rotation_degrees", 15.0, 0.6)
    # tween.tween_property(self, "scale", Vector2(1.05f, 1.05f), 0.6) # also with this

func _process(delta):
    self.global_position = self.global_position

CrankyUnicorn avatar Jun 28 '24 20:06 CrankyUnicorn

Can't reproduce in 4.3 beta1. Can reproduce in 4.2.2. So looks like it'll be fixed in 4.3.

AwesomeAxolotl avatar Jun 28 '24 20:06 AwesomeAxolotl

Can't reproduce in 4.3 beta1.

Thanks, indeed its not reproducable anymore. Closed.

Chaosus avatar Aug 04 '24 15:08 Chaosus