Skip to main content

Quick Start - Sequine Player

Get started by creating a component that plays an animation clip on Start.

This will guide you to use it with 2 alternative methods:

  • By script
  • Directly use it inside Sequine Flow without additional scripting

1. Playing Animation Clip by Script

Create a New Script

Create a new script by opening the Assets menu and choose Create -> C# Script. Name the new file to PlayOnStart (optional).

Create a New Script

Open the script file, and paste the following script to your PlayOnStart script.

using UnityEngine;
using Calcatz.Sequine;

public class PlayOnStart : MonoBehaviour {

public SequinePlayer sequinePlayer;
public AnimationClip clipToPlay;

void Start() {
sequinePlayer.PlayAnimationClip(clipToPlay, SequinePlayer.defaultAnimationConfig);
}

}

Using the PlayAnimationClip method, it expects you to fill at least 2 parameters:

  • Clip to play
  • Animation Config: You can set the clip configurations such as the speed, transition duration, etc. But for now, we will use the default configuration.

Place Your Animated Model

Place your animated model GameObject inside the scene.

Add Sequine Player Component

From the Inspector, click on Add Component, and search for Sequine Player. After adding Sequine Player, it will also automatically adds Animator component (if it has not been added).

Leave the configurations as is.

Add Your Created Script

Add our previously created PlayOnStart component.

Set your previously added Sequine Player component to the Sequine Player field. On the Clip To Play field, put your desired clip to play on that model.

Add Components

Play It

Press Play button in your Unity Editor, and your clip will by played immediately on Start.

That's generally how Sequine Player works. By using only PlayAnimationClip method, you can simply play animation clip any time without setting up an Animator Controller.

2. Playing Animation Clip by Sequine Flow

Please note that Play Animation Clip method is also available to call using Sequine Flow, so you can do the animation sequencing even without scripts.

Place Your Animated Model

Place your animated model GameObject inside the scene.

Add Sequine Player Component

From the Inspector, click on Add Component, and search for Sequine Player. After adding Sequine Player, it will also automatically adds Animator component (if it has not been added).

Leave the configurations as is.

This time, you don't need to add an additional script.

Create Components Without Custom Script

Create a New Sequine Flow Asset

Open the Assets menu and choose Create -> Sequine -> Sequine Flow Asset. Name the new file to PlayOnStart (optional).

Create a New Sequine Flow Asset

Double click the asset to open the node-based flow editor.

Create a Play Animation Clip Command

Right click on the empty area, and choose Animation -> Clip Control -> Play Animation Clip.

Create a Play Animation Clip Command

Fill the Clip field with your desired animation clip, and then connect the Start node's out-point with the Play Animation Clip node's in-point.

Set Clip

We need to assign which Sequine Player we want to play the clip to. For now, let's assign it using Cross Scene Reference, as we will talk about it later in Cross-Scene System section.

Then, we can simply drag and drop our previous GameObject with the Sequine Player component, to the object field.

Assign Target

Create a Sequine Flow Executor

Now all that we need is a Sequine Flow Executor component that executes our PlayOnStart asset.

Open the GameObject menu and choose Create Other -> Sequine -> Sequine Flow Executor. From the Inspector, set the Flow to Execute with our previously created PlayOnStart asset.

PlayOnStart Executor

Play It

Since we've set it to Execute On Start, press Play button in your Unity Editor, and your sequence will be executed immediately. You will see your object or character playing animation with the specified clip.