godot-docs icon indicating copy to clipboard operation
godot-docs copied to clipboard

default example for tween lacks an important warning about tweening to zero scale ( as it may generate invalid det ).

Open LBdN opened this issue 1 year ago • 0 comments

Your Godot version: 4.3

Issue description: The doc provides the following example :

var tween = get_tree().create_tween()
tween.tween_property($Sprite, "modulate", Color.RED, 1)
tween.tween_property($Sprite, "scale", Vector2(), 1)
tween.tween_callback($Sprite.queue_free)

But the Vector() for scale if not followed by a queue_free, eventually creates an invalid matrix, triggering the following error every frame until the object is freed :

E 0:00:11:0630   Basis::invert: Condition "det == 0" is true.
  <C++ Source>   core\math\basis.cpp:47 @ Basis::invert()

URL to the documentation page (if already existing): https://docs.godotengine.org/en/stable/classes/class_tween.html

LBdN avatar Aug 29 '24 17:08 LBdN