Frame-by-Frame Animation
You can use Sprite Swap to quickly swap the Sprites rendered at run time, to create a frame-by-frame animation. This is useful for simple animations, such as to show a character blinking. It is recommended that you change the keyframe tangent setting in the Animation window first before following the workflow below:
Place the Sprites for each animation frame in the Sprite Library Asset, and assign them all to the same Category. Give each Sprite a Label. Label names must be unique in their Category.
Select your character Prefab, and bring it into the Scene.
Open the Animation window, and select your character Prefab. and Select the Add Property button, and select the Sprite Resolver component’s Label property.
Change the Label property at each keyframe in the Animation window in order of your Animation frames. This simulates a frame-by-frame animation style.
Change the Keyframe Tangent
When animating with the Category and Label value of the Sprite Resolver in the Animation window, it is important to change the keyframe’s tangent in the Animation window to Constant.
This is because the Sprite Resolver component uses the defined string hash value to locate the desired Sprite. If the values between keyframe’s are interpolated, the Sprite Resolver will not be able to resolve to the correct Sprite.