> For the complete documentation index, see [llms.txt](https://october-studio.gitbook.io/monster-survivors-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://october-studio.gitbook.io/monster-survivors-documentation/character/add-a-character.md).

# Add a Character

{% stepper %}
{% step %}

## 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:

<figure><img src="/files/cmjrsg6h1K283Csa1zYt" alt="" width="315"><figcaption><p>Idle Sprite Animation</p></figcaption></figure>

<figure><img src="/files/KSLLzONzqPurq4D3jPuw" alt="" width="375"><figcaption><p>Run/Walk Sprite Animation</p></figcaption></figure>

<figure><img src="/files/9j01KrAfbyUNSN08sHr6" alt="" width="375"><figcaption><p>Defeat Sprite Animation</p></figcaption></figure>

<figure><img src="/files/f5zLL1A7aYm3VGETBJQ8" alt="" width="375"><figcaption><p>Revive Sprite Animation</p></figcaption></figure>

2. Prepare these sprite sheets to be used for animating. If you need a reminder on how to do that, take a look at [Unity Learn Documentation](https://learn.unity.com/tutorial/introduction-to-sprite-animations).
3. Create Animation Controller and Animations from these sprite sheets. Visit [Unity Learn Documentation](https://learn.unity.com/tutorial/introduction-to-sprite-animations) to know more.&#x20;
   {% endstep %}

{% step %}

## 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 ![](/files/l4a6UuofIBDShlkhQjlK) 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

<figure><img src="/files/zU5InpB1ypg302CLJDbl" alt="" width="365"><figcaption><p>Character Sprite Renderer example</p></figcaption></figure>

<mark style="color:yellow;">If the sprite you assigned appears to be larger or smaller than expected, tweak its Pixel Per Unit value in the import settings.</mark>

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

<figure><img src="/files/0RGB1BAaTxV92zmtWpgE" alt="" width="364"><figcaption><p>Character Animator example</p></figcaption></figure>

7. In the Character Behavior script, assign the components needed.&#x20;

<mark style="color:yellow;">If you did not add these components as new, and simply copied the prefab, they will be most likely assigned correctly by default.</mark>

<figure><img src="/files/OJDlipsAr9NyNq8onpqu" alt="" width="368"><figcaption><p>Character Behavior example</p></figcaption></figure>

{% endstep %}

{% step %}

### Registering a Character

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

<mark style="color:yellow;">However, if you modified existing characters instead of creating new one, you can skip the steps from 1 to 4.</mark>

{% hint style="info" %}
From [v1.4.0](https://october-studio.gitbook.io/monster-survivors-documentation/character/pages/2GSJW4TQ4qncHqDlz1OM#version-1.4.0) of the asset, the CharacterData was migrated to scriptable object CharacterDataSO.\
Clone an existing Character Data scriptable object and assigne it inside a Character Datas list of the database. All the fields in the scriptable object are the same as below.&#x20;
{% endhint %}

1. Navigate to the Characters Database at ![](/files/Hur1qvdNb2PBFirWxOxM) and open it.
2. In the Inspector you will find several entries of the existing characters. It should look like this:

<figure><img src="/files/Bpj5Zzc4kwhR5P4rj3AN" alt="" width="374"><figcaption><p>Characters Database example</p></figcaption></figure>

Every entry has fixed fields:

<table><thead><tr><th width="157">Field</th><th>Description</th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>Character name that will display in the Character Selector</td></tr><tr><td><strong>Cost</strong></td><td>Amount of currency to unlock in the Character Selector</td></tr><tr><td><strong>Icon</strong></td><td>Preview image</td></tr><tr><td><strong>Prefab</strong></td><td>Link to the specific character prefab</td></tr><tr><td><strong>Base HP</strong></td><td>Initial health amount</td></tr><tr><td><strong>Base Damage</strong></td><td>Initial damage</td></tr></tbody></table>

3. Press the Plus button below the list to create a new entry.
4. Assign your character prefab to the according field.
5. Populate all other fields to your liking.
   {% endstep %}

{% step %}

## Finish

Now you can start the game, and navigate to the Character Selector from the Main Menu to see your character.
{% endstep %}
{% endstepper %}
