🦇
Monster Survivors Template Documentation
  • Welcome
  • CHARACTER
    • Add a Character
    • Starting Ability
  • Stages
    • Stage Creator
    • Tracks And Clips
    • Stage Settings
    • Create a Stage
  • Enemies
    • Simple Enemies
    • Ranged Enemies
    • Bosses
    • Add a Simple Enemy
    • Add a Boss
  • Abilities
    • Ability Types
    • Abilities System Structure
    • Add Abilities
  • Upgrades
    • Upgrade Types
    • Upgrades System Structure
    • Add an Upgrade
  • Game structure
    • Main Menu Scene
    • Game Scene
  • Input
    • Input System
    • Menu Navigation
  • Known Issues
    • IOS Build
  • Testing
    • Abilities Testing Overlay
    • Presets
Powered by GitBook
On this page
  1. CHARACTER

Add a Character

If you want to add or change a character, here's how:

PreviousWelcomeNextStarting Ability

Last updated 4 months ago

1

Preparation

Before you begin, make sure that you have all the components needed:

  1. Import sprite sheets or sprites for character and it's animations, as listed below:

  1. Prepare these sprite sheets to be used for animating. If you need a reminder on how to do that, take a look at .

  2. Create Animation Controller and Animations from these sprite sheets. Visit to know more.

2

Character Prefab Creation

Now you can create a prefab for your character.

The easiest way to do this is to modify or copy existing prefab:

  1. Navigate to and select one of the character prefabs there. Open it, or make a copy.

  2. In the Inspector there will be 3 main components: Sprite Renderer, Animator and Character Behavior Script.

  3. In the Sprite Field of the Sprite Renderer assign a sprite from your character. By default it can be a simple standing pose.

  4. Make sure that the Material field of the same component has Player material assigned.

  5. Make sure that Sorting Layer is set to 0

If the sprite you assigned appears to be larger or smaller than expected, tweak its Pixel Per Unit value in the import settings.

  1. In the Animator Component, assign your Controller in the appropriate field.

  1. In the Character Behavior script, assign the components needed.

If you did not add these components as new, and simply copied the prefab, they will be most likely assigned correctly by default.

3

Registering a Character

When you have your character prefabs ready, you need to register them.

However, if you modified existing characters instead of creating new one, you can skip the steps from 1 to 4.

  1. Navigate to the Characters Database at and open it.

  2. In the Inspector you will find several entries of the existing characters. It should look like this:

Every entry has fixed fields:

Field
Description

Name

Character name that will display in the Character Selector

Cost

Amount of currency to unlock in the Character Selector

Icon

Preview image

Prefab

Link to the specific character prefab

Base HP

Initial health amount

Base Damage

Initial damage

  1. Press the Plus button below the list to create a new entry.

  2. Assign your character prefab to the according field.

  3. Populate all other fields to your liking.

4

Finish

Now you can start the game, and navigate to the Character Selector from the Main Menu to see your character.

Unity Learn Documentation
Unity Learn Documentation
Idle Sprite Animation
Run/Walk Sprite Animation
Defeat Sprite Animation
Revive Sprite Animation
Character Sprite Renderer example
Character Animator example
Character Behavior example
Characters Database example