> 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

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

{% 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="https://1095504291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiNhXrPwcj8TJ32pNkD2R%2Fuploads%2FHj4FXK5NeOmCYj6TNlw1%2Fimage.png?alt=media&amp;token=b2bd551e-ff37-437a-a9f2-dafa469ef649" alt="" width="315"><figcaption><p>Idle Sprite Animation</p></figcaption></figure>

<figure><img src="https://1095504291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiNhXrPwcj8TJ32pNkD2R%2Fuploads%2F7w5L2Ou7pNzGKyT3KUH2%2Fimage.png?alt=media&amp;token=f222d6ce-7259-47d4-ab27-893429fb782c" alt="" width="375"><figcaption><p>Run/Walk Sprite Animation</p></figcaption></figure>

<figure><img src="https://1095504291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiNhXrPwcj8TJ32pNkD2R%2Fuploads%2FRiRqCayzxPs7vqGCK0hZ%2Fimage.png?alt=media&amp;token=bc1bb808-0d6d-457d-853a-abdeefcd85ee" alt="" width="375"><figcaption><p>Defeat Sprite Animation</p></figcaption></figure>

<figure><img src="https://1095504291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiNhXrPwcj8TJ32pNkD2R%2Fuploads%2Fy0CeDKpcAPqCkwrhZbFZ%2Fimage.png?alt=media&amp;token=f60275e2-e4b2-47f5-9132-5d453a78b5ad" 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 ![](https://1095504291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiNhXrPwcj8TJ32pNkD2R%2Fuploads%2Frauu5lBKde7JfOrdFZUB%2Fimage.png?alt=media\&token=7138b2cc-c984-42eb-bc52-2bdde2e65dc5) 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="https://1095504291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiNhXrPwcj8TJ32pNkD2R%2Fuploads%2FfuvwyQOnl2rSLT23ENfh%2Fimage.png?alt=media&amp;token=05cd3021-1218-4f4b-b655-a7e9111b9153" 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="https://1095504291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiNhXrPwcj8TJ32pNkD2R%2Fuploads%2FmKT420vEkEZU2gcihvUr%2Fimage.png?alt=media&amp;token=346d4fce-adab-44d8-9a79-f868e68befe4" 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="https://1095504291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiNhXrPwcj8TJ32pNkD2R%2Fuploads%2FYcZiOpH3KSSaEickVGtq%2Fimage.png?alt=media&amp;token=3efe66b8-8b57-40d0-a9db-33b74d84262d" 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 ![](https://1095504291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiNhXrPwcj8TJ32pNkD2R%2Fuploads%2FNUVx8KPB58itBB6XXDsR%2Fimage.png?alt=media\&token=d09f921f-fb38-4815-9206-a8b87d07711e) and open it.
2. In the Inspector you will find several entries of the existing characters. It should look like this:

<figure><img src="https://1095504291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiNhXrPwcj8TJ32pNkD2R%2Fuploads%2FDDyLfY4QEraeEJcK59aR%2Fimage.png?alt=media&amp;token=255f06be-2cd5-4018-8b9b-99711cdef96f" 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 %}
