How to add a new Enemy
This guide explains how to add a new enemy to the game. As an example, we’ll create and configure a completely new enemy from scratch - including assets, animations, behavior, and data setup.
1. Importing Assets
Inside
Assets/The Archer/Models/Enemies, create a new folder named after your enemy. Import the 3D model and animation clips there.Inside
Assets/The Archer/Textures/Enemies, import your enemy’s texture.
You’ll need the following assets for your enemy:
3D Model
Animations
Texture
Folder Setup
In
Assets/The Archer/Enemies, create a new folder named after your enemy. Import your 3D model and animation clips there.In
Assets/The Archer/Textures/Enemies, import your enemy’s texture.
2. Configuring Animator and Animations
Enemy animator setup is more flexible than the hero’s - it depends heavily on the specific behavior of your enemy. The template already includes a wide variety of enemies, which you can use as references.
Animation Configuration
Ensure each animation clip is properly configured (looped if needed).
Add commonly used animation events such as:
OnDefeatAnimationEndedOnAttackOnAttackEnded
Clone an existing animator or create a new one and place it in the same folder as the 3D model.
Required Animator Parameters
The abstract class EnemyBehavior expects the following animator parameters:
Movement Blend (EnemyBehavior.MOVEMENT_BLEND_FLOAT)
Float
Controls movement blend tree (idle, walk, run). Skip if your enemy doesn’t move.
Defeat (EnemyBehavior.DEFEAT_TRIGGER)
Trigger
Plays the defeat animation.
Hit
(EnemyBehavior.HIT_TRIGGER)
Trigger
Plays the hit reaction animation.
Attack (EnemyBehavior.ATTACK_TRIGGER)
Trigger
Plays the attack animation.
Attack Ended (EnemyBehavior.ATTACK_ENDED_TRIGGER)
Trigger
Ends a looping attack animation.
Hide
(EnemyBehavior.HIDE_TRIGGER)
Trigger
Plays a hide animation (used, for example, by enemies that burrow).
Show
(EnemyBehavior.SHOW_TRIGGER)
Trigger
Plays a show animation (usually paired with Hide).
Attack Type (EnemyBehavior.ATTACK_TYPE_INT)
Int
Defines which attack animation to play when the enemy has multiple attacks.
Enemy animators typically have at least two layers:
Base Layer - main animations (idle, movement, attack).
Hit Layer - hit reactions, allowing the enemy to play “hit” animations without interrupting other actions.
3. Creating Enemy Behavior
Navigate to:
Assets/The Archer/Scripts/Enemies/Simple Enemies(for regular enemies), orAssets/The Archer/Scripts/Enemies/Bosses(for boss enemies).
Create a new folder named after your enemy.
Inside it, create a new script named
[Name]EnemyBehavior.cs.
Base Setup
Open the script and inherit from EnemyBehavior.
Override the BehaviorCoroutine method - this is the main loop that defines the enemy’s logic:
Use existing enemies as examples to learn about structure and pacing.
Typical Attack Example
waitForAttackToEnd is an instance of a custom WaitUntilTrue class, which blocks coroutine execution until its Complete() method is called.
Usually, the attack animation triggers OnAttackEnded at the end - this signals the coroutine to continue.
If your attack involves projectiles, add an animation event to call the projectile-spawn logic at the right frame.
Animation Events Handling
The EnemyEventsHandler component is responsible for catching animation events and forwarding them to the enemy script. By default, it provides the following callbacks:
OnDefeatAnimationEnded
OnDefeatEndedEventFired()
OnAttack
OnAttackEventFired()
OnAttackEnded
OnAttackEndedEventFired()
OnHidden
OnHideEndedEventFired()
OnSpawnEnded
OnSpawnEndedEventFired()
If your enemy requires additional events, create a new class that inherits from EnemyEventsHandler and extend it with your custom event logic.
4. Creating Enemy Prefab
Navigate to:
Assets/The Archer/Prefabs/Enemies/Simple Enemies(for regular enemies), orAssets/The Archer/Prefabs/Enemies/Bosses(for bosses).
Clone an existing enemy prefab and rename it to your enemy’s name.
Remove the old model and all components except the Healthbar and Helpers GameObject (with its children).

Drag your new enemy model into the prefab.
Assign your Animator Controller to the Animator component.
Add the EnemyEventsHandler component (or your custom subclass if you extended it).
Renderers Helper Setup
Select the Renderers Helper GameObject.
Add all your model’s Mesh Renderers to its Renderers list.
Remove any unassigned elements.
Enemy Behavior Setup
Select the Root GameObject.
Without removing the existing EnemyBehavior, add your new Enemy Behavior component.
Copy all commonly used field values from the old component to your new one, then delete the old one.
Assign:
Animator
Graphic Object (the model’s root GameObject)
Adjust any custom parameters controlling your enemy’s behavior.
Resize the collider and adjust the healthbar height to fit your model.
5. Assigning Enemy Data
Open:
Assets/The Archer/Scriptables/Enemies DatabaseAdd a new entry to the Enemies List and fill in:
Enemy Name
Prefab
Sprite
Is Boss
Item Drops (and the player HP percentages at which they drop)
Press the button next to the Enemy Type value.
In the window that opens, click Add.
Enter your enemy’s name and assign a unique index.
Press Save.

That’s it! Your new enemy should now appear in the Stage Creator. Add it to any wave and start the game — it should spawn and behave according to your configuration.
Last updated