# SampleAnimation(GameObject, float)

> Samples an animation at a given time for any animated properties.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.AnimationModule

```csharp
public void SampleAnimation(GameObject go, float time)
```

### Parameters

**** (\[GameObject]\(/engine/6000.0/script-reference/unityengine/gameobject)): The animated game object.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The time to sample an animation.

### Remarks

It is recommended to use the [Animation](/engine/6000.0/script-reference/unityengine/animation.md) interface instead for performance reasons. This will sample animation at the given time. Any component properties that are animated in the clip will be replaced with the sampled value. Most of the time you want to use [Animation.Play](/engine/6000.0/script-reference/unityengine/animation/play.md) instead. SampleAnimation is useful when you need to jump between frames in an unordered way or based on some special input.

Additional Resources: [Animation](/engine/6000.0/script-reference/unityengine/animation.md).
