Table of Contents

Layered Character Template Renderer Component

The Layered Character Template Renderer creates a new Layered Character from a Layered Character Template and renders it in-game.

This component is responsible for:

  • Creating a layered character
  • Applying the Character Shader
  • Assigning the Animator Controller (Optional)
  • Managing Overlay Layers

Requirements:

Layered Character Template Renderer Component


Quick Setup Overview

Quick overview of how to setup the Layered Character Template Renderer component.

  1. Add the component to a GameObject.
  2. Assign Renderer (Usually a Sprite Renderer).
  3. optionally assign Animator.
  4. Configure Loading Settings.
  5. Assign the Layered Character Template you want to use.
  6. Play your game and if Load Character On Start is enabled, your character will be displayed.

Setup

Full step-by-step guide to setup the Layered Character Template Renderer component.

Add Component

Add the component to a GameObject by clicking Add Component in the inspector window.

Add Layered Character Template Renderer Component


Assign Renderer Component

Assign the component responsible for rendering the character's sprites.

In most cases, this will be a Sprite Renderer. The Character Shader will be applied to this renderer.

Renderer Reference


Assign Animator Component (Optional)

If your Character Type asset includes an Animator Controller, it can be applied automatically when the character is loaded.

To enable this:

  1. Enable Set Animator Controller.
  2. Assign the target Animator component.

Animator Reference


Configure Loading Settings

The Loading Mode determines how the character is loaded at runtime. This can significantly impact performance.

Loading Mode

Loading Mode Description Advantages Cons
Asynchronous Loads the character in the background. No frame stutters or freezes. Character is temporarily invisible while loading.
Synchronous Loads the character on the main thread. Character is immedietely renderered the same frame. May cause frame stutters depending on spritesheet size.
  • Use Asynchronous loading for background NPCs or characters that aren't time sensitive.
  • Use Synchronous loading when the character must appear Immediately, such as a player character.

Load Character On Start

If Load Character on Start is enabled, the character is automatically created and rendered during the Start() method

If disabled, the character must be loaded manually through script using the GetAndShowCharacter() method


Assign Template

Assign a Layered Character Template asset.
This will be used to create a new character based on the specifications of the template.

Character Specifications


Use Cache

Determines whether previously created characters are resued.

  • Enabled
    If a character has already been created using the same template, the cached instance is reused.
  • Disabled
    A new character will always be created regardless of if one already exists.

In most cases keep this enabled for improved performance.
Disable when using a Randomized Template, so a new random character is created each time.


Hit Play

Play Buttons

Enter Play Mode.

If Load Character On Start is enabled in Loading Settings, the character will be automatically created and displayed.