Help needed with "Target object freed before starting, aborting Tweener"

Godot Version

4.3

Question

I’m making a texture progress bar to reset a level. The idea is that the player holds down a key, that fills a texture progress bar and then it resets the current level.

It works, but every time the level restarts, I get this “Target object freed before starting, aborting Tweener” message on the debug console, and I don’t quite understand it.

The “reset progress bar” scene is laid out like this:

CONTROL (with script attaced)

– VBOX CONTAINER

---- TEXTURE PROGRESS BAR

The CONTROL node’s script is this one:

the “bar_filled” signal is connected to another node that calls get_tree().reload_current_scene() and it seems the error only pops up after the scene reloads.

Any help is appreciated.

My guess is that you have a tween running when you call reset scene. So, you are freeing the scene while a tweener is running.

Is there a reason you need to reload_scene rather than just reseting variable?

1 Like

I managed to solve it by using the value_changed signal from the texture progress bar, and my code is like this now:

Everything still works, and no more errors. I still don’t understand what was causing the error to begin with, though.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.