# MotionSequenceBuilder

Place child tweens on one timeline with Append, Join and Insert. After Run, use the parent handle to seek or stop the sequence.

Namespace: MeatMotion

Assembly: MeatMotion

```csharp
public struct MotionSequenceBuilder : IDisposable
```

[Runtime/Sequences/MotionSequenceBuilder.cs · L7](../../../source/Runtime/Sequences/MotionSequenceBuilder.cs.html#L7)

## Animate one property in two stages

Add `using MeatMotion;`. Move to 4 in one second, wait for half a second, then move back over one second. At t = 2 the value is 2.

```csharp
float value = 0f;
using var world = new MotionWorld();
var first = MMotion.Create(0f, 4f, 1f).WithScheduler(world)
    .Bind(v => value = v);
var back = MMotion.Create(4f, 0f, 1f).WithScheduler(world)
    .WithImmediateBind(false).Bind(v => value = v);
var parent = LSequence.Create()
    .Append(first).AppendInterval(0.5f).Append(back)
    .Run(clock => clock.WithScheduler(world));
parent.Time = 2.0;
```

## Append

Place a finite child at the append cursor and advance the cursor by its duration.

```csharp
public readonly MotionSequenceBuilder Append(MotionHandle handle)
```

Parameters and return value

- `handle` (`MotionHandle`) Handle to control or link.
- Returns: `MotionSequenceBuilder`

[Runtime/Sequences/MotionSequenceBuilder.cs · L23](../../../source/Runtime/Sequences/MotionSequenceBuilder.cs.html#L23)

## AppendInterval

Advance the append cursor by the interval in seconds. Overlapping children can keep playing during the interval.

```csharp
public readonly MotionSequenceBuilder AppendInterval(float interval)
```

Parameters and return value

- `interval` (`float`) Seconds by which to move the append cursor.
- Returns: `MotionSequenceBuilder`

[Runtime/Sequences/MotionSequenceBuilder.cs · L32](../../../source/Runtime/Sequences/MotionSequenceBuilder.cs.html#L32)

## Join

Place a child at the start of the most recently appended interval without advancing the append cursor.

```csharp
public readonly MotionSequenceBuilder Join(MotionHandle handle)
```

Parameters and return value

- `handle` (`MotionHandle`) Handle to control or link.
- Returns: `MotionSequenceBuilder`

[Runtime/Sequences/MotionSequenceBuilder.cs · L42](../../../source/Runtime/Sequences/MotionSequenceBuilder.cs.html#L42)

## Insert

Place a child at an absolute time in seconds without advancing the append cursor.

```csharp
public readonly MotionSequenceBuilder Insert(float position, MotionHandle handle)
```

Parameters and return value

- `position` (`float`) Placement time in seconds from the start of the sequence.
- `handle` (`MotionHandle`) Handle to control or link.
- Returns: `MotionSequenceBuilder`

[Runtime/Sequences/MotionSequenceBuilder.cs · L49](../../../source/Runtime/Sequences/MotionSequenceBuilder.cs.html#L49)

```csharp
public readonly MotionSequenceBuilder Insert(double position, MotionHandle handle)
```

Parameters and return value

- `position` (`double`) Placement time in seconds from the start of the sequence.
- `handle` (`MotionHandle`) Handle to control or link.
- Returns: `MotionSequenceBuilder`

[Runtime/Sequences/MotionSequenceBuilder.cs · L50](../../../source/Runtime/Sequences/MotionSequenceBuilder.cs.html#L50)

## Run

Schedule the children and return the parent handle. Use configuration to customize the parent clock, callbacks or scheduler.

```csharp
public MotionHandle Run()
```

Return value

- Returns: `MotionHandle`

[Runtime/Sequences/MotionSequenceBuilder.cs · L78](../../../source/Runtime/Sequences/MotionSequenceBuilder.cs.html#L78)

```csharp
public MotionHandle Run(Action<MotionBuilder<double, NoOptions, DoubleMotionAdapter>> configuration)
```

Parameters and return value

- `configuration` (`Action<MotionBuilder<double, NoOptions, DoubleMotionAdapter>>`) Callback that configures the parent timeline builder.
- Returns: `MotionHandle`

[Runtime/Sequences/MotionSequenceBuilder.cs · L80](../../../source/Runtime/Sequences/MotionSequenceBuilder.cs.html#L80)

## Dispose

Dispose an unplayed builder. MSequence cancels pending children while LSequence retains ownership of them.

```csharp
public void Dispose()
```

[Runtime/Sequences/MotionSequenceBuilder.cs · L116](../../../source/Runtime/Sequences/MotionSequenceBuilder.cs.html#L116)

## Related types

- [LSequence](../../../en/api/lsequence/index.md)

- [MSequence](../../../en/api/msequence/index.md)

- [MotionHandle](../../../en/api/motionhandle/index.md)
