# Play

> Starts a looping animation on the referenced wire.

## Definition

* **Type:** Method
* **Namespace:** [Unity.GraphToolkit.Editor.GraphVisualization](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization.md)
* **Assembly:** UnityEditor

## Play(WireReference, float)

Starts a looping animation on the referenced wire.

```csharp
public void Play(WireReference wire, float animationSpeed = 1)
```

### Parameters

**** (\[WireReference]\(/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/wirereference)): The wire on which to play the animation.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Speed multiplier for the animation. Higher values move the animated segment faster.

### Remarks

Throws ArgumentException when `wire` doesn't correspond to a wire in the current [Context](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/context.md).

Start a flow animation on a wire to highlight an active data path through the graph at the default speed.

### Examples

```csharp
WireReference wire = context.GetWireReference(outputPortID, inputPortID);
context.Motion.Play(wire);
```

## Play(TransitionReference, float)

Starts a looping animation on the referenced transition.

```csharp
public void Play(TransitionReference transition, float animationSpeed = 1)
```

### Parameters

**** (\[TransitionReference]\(/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/transitionreference)): The transition on which to play the animation.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Speed multiplier for the animation. Higher values move the animated segment faster.

### Remarks

On a transition between two states, the animation sweeps a gradient band along the transition wire. On a self transition, the animation sweeps the same gradient band around the transition arrow's border. Throws ArgumentException when `transition` doesn't correspond to a transition in the current [Context](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/context.md).

Start a flow animation on a transition to highlight an active state machine path at the default speed.

### Examples

```csharp
TransitionReference transitionRef = context.GetTransitionReference(transitionID);
context.Motion.Play(transitionRef);
```

## Play(NodeReference, float)

Starts a looping animation on the referenced node's accent.

```csharp
public void Play(NodeReference node, float animationSpeed = 1)
```

### Parameters

**** (\[NodeReference]\(/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/nodereference)): The node on which to play the animation.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Speed multiplier for the animation. Higher values move the animated segment faster. The default value is 1.

### Remarks

The animation loops indefinitely until you call [GraphMotion.Stop](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/graphmotion/stop.md) or [GraphMotion.Pause](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/graphmotion/pause.md). While the animation plays, the accent bar overrides any fill amount previously set through [NodeReference.FillAmount](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/nodereference/fillamount.md) or the node model's `FillAmount` property. Call [GraphMotion.Play](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/graphmotion/play.md) again on the same node after [GraphMotion.Pause](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/graphmotion/pause.md) to resume the animation at the new speed. Throws ArgumentException when `node` doesn't correspond to a node in the current [Context](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/context.md).

### Examples

```csharp
NodeReference nodeRef = context.GetNodeReference(nodeID);
context.Motion.Play(nodeRef);
```

## Play(StateReference, float)

Starts a looping animation on the referenced state's accent.

```csharp
public void Play(StateReference state, float animationSpeed = 1)
```

### Parameters

**** (\[StateReference]\(/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/statereference)): The state on which to play the animation.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Speed multiplier for the animation. Higher values move the animated segment faster. The default value is 1.

### Remarks

The animation loops indefinitely until you call [GraphMotion.Stop](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/graphmotion/stop.md) or [GraphMotion.Pause](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/graphmotion/pause.md). While the animation plays, the accent bar overrides any fill amount previously set through [StateReference.FillAmount](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/statereference/fillamount.md) or the state's [IState.FillAmount](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istate/fillamount.md) property. Call [GraphMotion.Play](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/graphmotion/play.md) again on the same state after [GraphMotion.Pause](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/graphmotion/pause.md) to resume the animation at the new speed. Throws ArgumentException when `state` doesn't correspond to a state in the current [Context](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/context.md).

### Examples

```csharp
StateReference stateRef = context.GetStateReference(stateID);
context.Motion.Play(stateRef);
```
