# C#: Your first tween

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

Click anywhere on the stage. The line of code at the bottom sends the Godot icon there.

Interactive preview: https://tweens.gd/csharp/quickstart/

## Scripting it

Create a 2D scene and drag `icon.svg` from the FileSystem dock into it. Attach this script to the new `Icon` node, then run the scene and click around.

ClickToMove.cs

```csharp
using Godot;
using tweens.gd;

public partial class ClickToMove : Sprite2D
{
    public override void _UnhandledInput(InputEvent @event)
    {
        if (@event is InputEventMouseButton { Pressed: true } click)
        {
            this.TweenPosition(click.Position, 1.2, Out.Back);
        }
    }
}
```

1.  **Catch the click.** Godot passes every mouse press that no UI control used to `_UnhandledInput`.
2.  **Start the tween.** Move this node to the click in 1.2 seconds; `Out.Back` overshoots, then settles. The call returns at once, and the tween plays over the next frames. C# needs `this.` to call an extension method on the node itself.

Other properties work the same way, such as `TweenScale`, `TweenRotation`, and `TweenModulate`. The [catalog](https://tweens.gd/csharp/nodes/) lists them all.

Try it

-   Swap `Out.Back` for `Out.Bounce`, or `1.2` for `0.4`.
-   Add `this.TweenRotation(Rotation + Mathf.Tau, 1.2, InOut.SmootherStep);` below the first tween. Tweens of different properties play together, so the icon spins on its way. Turn on **Spin too** above to preview it.
