# SamplePlayableGraph(PlayableGraph, int, float)

> Samples the specified output index of a PlayableGraph and also records modified properties when in Animation mode.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.0/script-reference/unityeditor.md)
* **Assembly:** UnityEditor

```csharp
public static void SamplePlayableGraph(PlayableGraph graph, int index, float time)
```

### Parameters

**** (\[PlayableGraph]\(/engine/6000.0/script-reference/unityengine/playables/playablegraph)): The [PlayableGraph](/engine/6000.0/script-reference/unityengine/playables/playablegraph.md) to sample.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The output index to sample in the Playable Graph.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The time at which to sample.

### Remarks

To successfully use this method, [AnimationMode.BeginSampling](/engine/6000.0/script-reference/unityeditor/animationmode/beginsampling.md) must be called before this method and [AnimationMode.EndSampling](/engine/6000.0/script-reference/unityeditor/animationmode/endsampling.md) must be called after. If a property is no longer sampled (for example, through [AnimationMode.SampleAnimationClip](/engine/6000.0/script-reference/unityeditor/animationmode/sampleanimationclip.md), [AnimationMode.SamplePlayableGraph](/engine/6000.0/script-reference/unityeditor/animationmode/sampleplayablegraph.md), or [AnimationMode.AddPropertyModification](/engine/6000.0/script-reference/unityeditor/animationmode/addpropertymodification.md)), the property reverts to its original value when [AnimationMode.EndSampling](/engine/6000.0/script-reference/unityeditor/animationmode/endsampling.md) is called.
