godot: Error message `step: : started with no Tweeners` missing essential information
Godot version
v4.1.rc2.mono.official [46424488e]
System information
Linux
Issue description
Getting error message at runtime. The error message does not show what is the origin of this error.
E 0:00:36:0394 step: <Tween#-9223371483558965298>: started with no Tweeners.
<C++ Error> Method/function failed. Returning: false
<C++ Source> scene/animation/tween.cpp:311 @ step()
Expected behaviour would be to have error message show which tween, meaning, which .gd script line that is attempting to start a tween that is not created. So that it is easier to fix the issue. Now I would have to go through all tweens in the game.
Steps to reproduce
Not sure if that is required to fix the issue by providing more information in error message, to allow for tracking it to specific origin of the call.
Minimal reproduction project
none
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 2
- Comments: 27 (14 by maintainers)
How would you suggest an improvement? What beyond “they start automatically” would be needed here in your opinion?
Well, you can manually call
play()
to start a Tween, in which case the error could be tracked (not tested). The Tweens that start automatically do so from C++ code, you can see the C++ line in the error.Actually it’s not exactly correct. Tweens are heavily encouraged to be setup immediately on create and never reused (#74258). The code might be valid, but doesn’t make much practical sense.
Although we recently had a discussion to maybe allow re-using Tweens. While the is no real performance gain, it can sometimes save a bit of boilerplate code. The
create_tween()
function would get anautostart
argument to make it easier. But it was only discussed, no decision was made so far (and there is no proposal).Your usage of
tween_method()
is wrong and it causes invalid Tweener. You should be getting another error about it.Tweens are not designed for reusing. The documentation warns about that and none of the examples point to creating a Tween with intention of later usage. The example you suggested actually existed until #74258
Leave it open to discuss the documentation, we don’t have triage meetings 😃
I was responding to above. Sorry it that was unclear. Thank you I will comment on the suggested proposal in regards to alternative pattern for not reusing the tweens.
In regards to this issue. Can I close it with comment that documentation could possibly be improved, or shall I leave to some triage meeting, or leave as is ?
For example just to add something like: If you are not planning to use the tween immediately withing the scope call
.stop()
when initialising.otherwise you might see an error like:
Is this consistent with other objects in Godot ? Does it need any additional documentation ?
Not sure that
And
in class_tween-docs
Actually indicates that creating and not using is incorrect. From what I can understand it says, use
SceneTree.create_tween
to create and callstop
to prevent it from starting automatically.Ok so in my case the error message was caused by having
At the scope of GDscript class that was used by the Node2D scene. It seems to be fine when the variable is only defined
But causes same error message when trying to init the tween in
and not using it in the
_ready
but later in other functions in that same class.Is this even supported use case to have tweens created in
_ready()
and then reused throughout the functions ?