AnimancerComponent.

TryPlay(IHasKey) Method

Summary

Stops all other animations on the base layer, plays the animation registered with the `key`, and returns the animation's state.
Assembly
Animancer.dll
Namespace
Animancer
Containing Type
AnimancerComponent

Syntax

public AnimancerState TryPlay(IHasKey hasKey)

Remarks

If no state is registered with the `key`, this method does nothing and returns null.

The animation will continue playing from its current Animancer.AnimancerState.Time. To restart it from the beginning you can simply set the returned state's time to 0.

This method is safe to call repeatedly without checking whether the animation was already playing.

Parameters

Name Type Description
hasKey IHasKey

Return Value

Type Description
AnimancerState