Skip to content

Actors

Actors are instantiated “performers” that are placed into a Story Sequence Set’s Actor Slots. This means they can function as Characters, Props, or any other element you wish to have be dynamic (Sounds, Particles, etc.).

Actor Facings and Organization

In order for 2D projects to be able to organize multiple versions of a Character that are simply rotated views of the same Character we group these variations we call Facings.
facing

Each Facing is stored in a ScriptableObject ActorDataAsset, the Facing itself is typically the Prefab, skeleton and/or animation data, and any other data specific to that Facing you will need in order to instantiate the Facing.

Which Facings an Actor needs are defined in a ScriptableObject ActorFacingConfigAsset.

All of the Facings for a corresponding Actor are stored in a ScriptableObject ActorFacingDataAsset.

If your Project has 3D Actors you will only need a single Facing. However, Facings could be a useful way for you to bucket some other data for your Actor into more digestible forms.

Asset Files

Actor Facing Config Asset

Each Actor Facing Data Asset will need an Actor Facing Config Asset to tell it what Facings it needs for its Character. Facing Configs can be shared between Actors and even Actor Types you only need a new Facing Config anytime you need a new list of Facing names.

To Create an Actor Facing Config Asset, open the ‘Create’ Menu and navigate to Story Sequence > Facing Config.

Actor Facing Data Asset

Each Actor will have an Actor Facing Data Asset. This Asset groups the many Facings that all represent the same Character.

To Create an Actor Facing Data Asset, open the ‘Create’ Menu and navigate to Story Sequence > Actor Facing.

Actor Data Asset

Each Type of Actor you make will have a corresponding Actor Data Asset you will need to create and populate for each Facing of each Actor. The Actor Data Asset holds the references to any Prefabs or other essential Data necessary to instantiate this Actor at runtime.

To Create an Actor Data Asset, open the ‘Create’ Menu and navigate to Story Sequence > Actor > and select the Type of Actor Asset you want to Create (Spine or Sprite). Note; if you’ve added new Actor Types to your Project the Create Menu Items for these Assets may be found elsewhere.

Make sure you name your Actor Data Assets uniquely. They will be used to pull Actors from the pool at runtime and need to be specific!

Example: If you have many variants of Batman in your game (Scuba Batman, Dark Night Batman, that-time-Azrael-was-Batman Batman, etc). Do not name all of the Front Facing Batmen Actor Data Assets “Batman_Front”. If you have multiple Batmen in the same scene the Sequence will just pull the first Batman named “Batman_Front” which might not be correct. Do something more specific like “Batman_Scuba_Front”.

Actor Types

The Project Samples include two Actors which will help you get started making 2D Sequences; SpineActor and Sprite Actor. Let’s take a look at both…

SpineActor

SpineActors are designed to use Esoteric Software’s Spine Animation software and Unity runtime implementation. This is a good system for creating 2D Animated characters.

In the Project Samples you can find DummyActor and DummyActor_2, two Spine Actors that are set up for testing out the features of the system.

spine actor

The Actor Data Asset for SpineActors is the SpineActorAsset. Here you will find a few references:

  • Prefab: The Prefab with the Actor Skeleton Animation component attached which will handle rendering the Spine Skeleton Data.

  • Spine Data: A Spine SkeletonDataAsset which contains references to the Spine JSON, Atlas, Materials, etc. For more on Skeleton Data Assets see Spine’s Documentation

  • Focal Point Bone: SpineActors use a Focal Point Bone to determine their Camera Focal Point, which is used to determine Camera Offsets at Edit Time. Here you should supply the name of the bone you want to use as the Focal Point. Make sure you type the name exactly.

In the case of Spine Actors there are a few things to keep in mind:

  • You do not need a unique Prefab for each Character or Facing. There are only two Prefabs, SampleActor and SampleActor_Flipped, and you can use these for every Character.

  • The unique visual data of each Actor is stored in the Spine Skeleton Data Asset.

  • If you don’t provide a Focal Point Bone the instantiated Actor’s transform (likely their feet) will be used instead.

Sprite Actor

The SpriteActor is a simple Actor that is useful for Props or secondary visual elements that only need simple animations. It is comprised of a Sprite Actor Animation Component, Unity Sprite Renderer Component and a Legacy Animation Component.

In the Project Samples you can find PropActor, a Sprite Actor that is set up for testing out the features of the system.

Sprite Actor Asset

The Sprite Actor Asset is very simple, it only contains:

  • Prefab: The Prefab to spawn for this Actor.

In the case of Sprite Actors there are a few things to keep in mind:

  • The Prefab contains all the unique visual data for the Actor.

  • Assign all of your Animation Clips to your Legacy Animation Component.

Adding a New Actor to your Project

Steps

  1. Import your Content: Export from Spine and get your Skeleton JSON, Atlas, Material, and Skeleton Data Asset organized as desired.

  2. Create an ‘Actor Facing Data Asset’: Name it the name of your character (reference their costume or any other detail you need to specify so you can find it in a list of other Actor Facing Data Assets).

  3. Assign the Facing Config to your Actor Facing Data Asset: Just drag and drop

  4. For each Facing….

    a. Create a Spine Actor Asset * Name this uniquely! It will be used to find the appropriate runtime Actor and place it in the Set as needed.

    • Assign the SampleActor Prefab (or your Project specific Prefab for Spine Actors)

    • Assign the corresponding Spine Skeleton Data Asset for this Facing

  5. Assign all your new Spine Actor Assets to the corresponding Facing Fields in the Actor Facing Data Asset.

  6. Select your new Actor in the Blocking of any Sequence and you’re ready to Play!

Adding a New Actor Type

For more details on adding a new Actor Type see Extending the Story Sequence System.