# C#: Lifetime and pausing

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

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

Examples use `using Godot;` and `using tweens.gd;` in a Node method, 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 throws. Removing or reparenting the node ends its tweens.

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

## Pausing

| `PauseMode` | Playback follows |
| --- | --- |
| `Bound` (default) | The owner’s `CanProcess()`: its process mode and tree pause |
| `SceneTree` | Tree pause only |
| `Always` | Neither; plays through pause |

A pause menu with `ProcessMode = ProcessModeEnum.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/csharp/lifetime/

SetProcess(false) is not a pause

`Bound` follows `CanProcess()`, which `SetProcess(false)` doesn’t change. Pause the handle to hold a tween.

## Process and physics

`PlaybackOptions` sets the pause mode and the clock at the start call. `ProcessMode = TweenProcessMode.Physics` updates on physics frames, and `UseUnscaledTime = true` ignores `Engine.TimeScale`:

```csharp
var ui = new PlaybackOptions { PauseMode = TweenPauseMode.Always, UseUnscaledTime = true };
label.TweenModulateAlpha(1, 0.3, playback: ui);
```

This fade keeps its pace through pause and slow motion.

## 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/csharp/materials/). Tweens never duplicate or dispose the resources they animate.

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