# LocalPositionTweens

A dedicated position batch for many Transforms. Add uses local coordinates and AddWorldPosition uses world coordinates.

Namespace: MeatMotion

Assembly: MeatMotion

```csharp
public sealed class LocalPositionTweens : IDisposable
```

[Runtime/Bindings/Transform/LocalPositionTweens.cs · L11](../../../source/Runtime/Bindings/Transform/LocalPositionTweens.cs.html#L11)

## Tick a position batch

Add `using MeatMotion;` and `using UnityEngine;` and put this inside the target MonoBehaviour. The destination is two units to the right of the current local position.

```csharp
var start = transform.localPosition;
using var positions = new LocalPositionTweens();
positions.Add(transform, start + Vector3.right * 2f, 1f, Easing.Linear);
positions.Tick(0.5);
```

## Count

Number of position tweens currently in the batch.

```csharp
public int Count { get; }
```

[Runtime/Bindings/Transform/LocalPositionTweens.cs · L27](../../../source/Runtime/Bindings/Transform/LocalPositionTweens.cs.html#L27)

## LocalPositionTweens

Allocate persistent native storage with the requested initial capacity. Call Dispose after use.

```csharp
public LocalPositionTweens(int capacity = 16)
```

Parameters

- `capacity = 16` (`int`) Number of entries to reserve.

[Runtime/Bindings/Transform/LocalPositionTweens.cs · L29](../../../source/Runtime/Bindings/Transform/LocalPositionTweens.cs.html#L29)

## Add

Move from the current local position to the destination. A zero duration writes the destination immediately.

```csharp
public void Add(Transform target, Vector3 to, float seconds, Easing ease = Easing.OutQuad)
```

Parameters

- `target` (`Transform`) Transform whose position the batch updates.
- `to` (`Vector3`) End value.
- `seconds` (`float`) Duration in seconds.
- `ease = Easing.OutQuad` (`Easing`) Easing function mapping normalized time to progress.

[Runtime/Bindings/Transform/LocalPositionTweens.cs · L36](../../../source/Runtime/Bindings/Transform/LocalPositionTweens.cs.html#L36)

## AddWorldPosition

Move from the target's current world position to the destination.

```csharp
public void AddWorldPosition(Transform target, Vector3 to, float seconds, Easing ease = Easing.OutQuad)
```

Parameters

- `target` (`Transform`) Transform whose position the batch updates.
- `to` (`Vector3`) End value.
- `seconds` (`float`) Duration in seconds.
- `ease = Easing.OutQuad` (`Easing`) Easing function mapping normalized time to progress.

[Runtime/Bindings/Transform/LocalPositionTweens.cs · L39](../../../source/Runtime/Bindings/Transform/LocalPositionTweens.cs.html#L39)

## Tick

Advance the batch by a nonnegative delta and retire finished or destroyed targets.

```csharp
public unsafe void Tick(double deltaTime)
```

Parameters

- `deltaTime` (`double`) Seconds to advance from the preceding update.

[Runtime/Bindings/Transform/LocalPositionTweens.cs · L72](../../../source/Runtime/Bindings/Transform/LocalPositionTweens.cs.html#L72)

## Dispose

Release the native storage owned by this batch.

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

[Runtime/Bindings/Transform/LocalPositionTweens.cs · L119](../../../source/Runtime/Bindings/Transform/LocalPositionTweens.cs.html#L119)
