# GDScript: Lifetime and pausing

Source: https://tweens.gd/gdscript/lifetime/

A node owns the tweens started on it. When it leaves the scene tree, they end, even while paused.

Examples use the global `Tweens` class in a node script, with targets inside the scene tree.

## Target and owner

Target

The object that receives values: a node, material, or other supported object.

Owner

The node whose lifetime ends playback. A node tween’s owner is its target.

## Nodes

Start a tween once its node is in the tree, in `_ready()` or later; starting outside the tree logs an error and returns a `FAILED` handle. Removing or reparenting the node ends its tweens.

`Tweens.cancel_tweens(node, true)` cancels a whole branch. It reaches automatic playback, not [manual schedulers](https://tweens.gd/gdscript/api/scheduler/).

## Pausing

| `pause_mode` | Playback follows |
| --- | --- |
| `BOUND` (default) | The owner’s `can_process()`: its process mode and tree pause |
| `SCENE_TREE` | Tree pause only |
| `ALWAYS` | Neither; plays through pause |

A pause menu with `process_mode = PROCESS_MODE_ALWAYS` keeps animating under `BOUND`. Pausing a handle holds it in every mode.

**Try it:** pause the tree, then change the pause mode.

Interactive preview: https://tweens.gd/gdscript/lifetime/

set\_process(false) is not a pause

`BOUND` follows `can_process()`, which `set_process(false)` doesn’t change. Pause the handle to hold a tween.

## Process and physics

`Tweens.playback_options()` sets the process mode, pause mode, and unscaled time, in that order. Pass the result after the owner; `null` makes the target its own owner:

```gdscript
var ui := Tweens.playback_options(Tweens.Process.PROCESS, Tweens.Pause.ALWAYS, true)
Tweens.play(label, Tweens.modulate_alpha(1.0, 0.3), null, ui)
```

This fade keeps its pace through pause and slow motion. `Tweens.Process.PHYSICS` would update it on physics frames instead.

## Resources

A material isn’t in the tree, so its tweens take an owner: a node, or the scene tree. See [materials and shaders](https://tweens.gd/gdscript/materials/). Tweens never duplicate or dispose the resources they animate.

[Playback options](https://tweens.gd/gdscript/api/start/#playback-options)Pause, process, and time-scale options, and every start call.
