Rock Thrower Enemy Setup
This setup provides a guide for setting up a ranged Rock Thrower Enemy using the Boss AI Toolkit in Unity. It covers FBX model preparation, configuration cloning, binding hand bone sockets for pickup animations, arc projectile setup, and fixing attack loop behaviors.
1. Initial Model Preparation
Steps
- Drag the target 3D stone enemy model into the scene hierarchy.
- Assign the character material to the mesh renderer.
- Remove any pre-existing Animator component from the model.
- Right-click the model GameObject and select Prefab > Unpack Prefab Completely.
- Copy transform position values from the template
Rock Thrower Enemyprefab and paste them onto the new model. - Rename the model GameObject to
Stone Enemy New.
2. Configuration Cloning
Duplicate components, scripts, and hitboxes from the template prefab onto the new model.
Steps
- Navigate to top menu: Tools > Boss AI Toolkit > Duplicate Enemy.
- Configure settings:
- Source Boss: Drag in the template
Rock Thrower Enemyprefab. - Target Boss: Drag in the newly prepared
Stone Enemy NewGameObject. - New Boss Name: Set to
Stone Enemy New. - Target Avatar: Drag in the model's Avatar asset from the Project folder.
- Create New Animator Controller Asset: Uncheck (reuses template animator clips).
- Add Weapon: Uncheck.
- Click Start Cloning Configuration and close the wizard.
- Deactivate the original template prefab in the scene hierarchy.
3. Core Component & Target Mapping
Ensure player attacks can register collisions against the enemy model.
Steps
- Select Stone Enemy New in the hierarchy.
- Under Team Member:
- My Body Part To Target: Assign the enemy's root mesh object reference so player hitboxes can target.
- Under Enemy Ability System > Global Settings:
- Use Rotation Animations: Uncheck (if using standard rotation).
- Rotate Spine: Uncheck.
4. Spawner & Hand Socket Setup
Set up the world location where rocks spawn and map the right-hand bone socket so pickup animations hold the rock accurately.
Steps
- Create an empty child GameObject under
Stone Enemy NewnamedSpawn Point. - Match position transform values from the template's spawn point (ground position near the feet).
- Select Stone Enemy New and expand Enemy Ability System > Combat Attack System.
- Locate the Projectile Attack ability settings:
- Spawn Point: Assign the
Spawn Pointtransform. - Projectile Parent: Assign the
Right Handbone transform.- Purpose: Parenting the spawned rock to the right hand bone ensures the rock attaches to the hand during the pickup animation before being thrown.
5. Combat Attack & Ability Loop Configuration
Configure ranged engagement limits and projectile counts to ensure range checks execute properly.
Combat Attack System
| Parameter | Recommended Value | Description |
|---|---|---|
| Phase 0 Health Range | 0 - 100 |
Health threshold for Phase 0 behavior. |
| Distance Range | 5 - 200 meters |
Ability only triggers when the target is between 5m and 200m away. |
| Projectile Count | 1 |
Controls how many rocks are thrown per ability execution cycle. |
| Cycle Mode | Restart Cycle |
Restarts ability cycle after cooldown completes. |
| Min / Max Attack Delay | 1 second |
Cooldown time after ability completion before re-evaluating target distance. |
| Power-up Animation | Pick |
Animation clip played while retrieving the rock from the ground. |
| Throw Animation | Throw |
Animation clip played when launching the projectile. |
NOTE: If
Projectile Countis set to a high number (e.g.,30), the enemy will ignore the minimum distance limit (5m) and continuously throw rocks at close range until all 30 projectiles are fired. SettingProjectile Count = 1forces the AI to finish the ability cycle after every single throw, allowing it to correctly re-check if the player has entered melee range (< 5m).
6. Rock Projectile & Damage Setup
Configure the rock projectile object to travel along an arc and prevent self-collision triggering.
Step 6.1: Projectile Setup
- Open the
Rock Projectileprefab in the Project inspector. - Remove any obsolete components (e.g., remove
Throwable Object Keyif present). - Confirm the following component configurations:
- Projectile Script:
- Moving Delay:
0 - Move Speed:
20 - Move in Arc:
Checked(Arc Type =Combined)
- Moving Delay:
- Trigger Object Activator:
- Delay Trigger:
Checked - Activation Delay:
1.5seconds - Purpose: Prevents rock fragments from hitting the spawner enemy's own triggers/colliders when spawned.
- Auto Destroy: Enabled after
2seconds.
- Delay Trigger:
- Hitbox Script:
- Owner: Set to
Rock Projectile - Activation Mode:
Auto Activate On Start(Delay =2to3seconds)
- Owner: Set to
7. Health UI, Impact FX & Death Behavior
Configure impact particle systems and auto-cleanup upon death.
Steps
- Expand Hit Reactions:
- Time To Destroy Spawn Impact Effect:
0.5seconds. - Impact Effect Hit: Replace default blood particle with
Stones HitFX asset. - Expand Health & UI:
- Destroy Enemy On Die:
Checked(Set delay to5seconds). - Destroy Spawn Health Bar On Die:
Checked.
8. Verification Checklist
Before running tests in Play Mode, check the following configuration settings:
- [ ] Hand Socket Mapped:
Right Handbone transform assigned asProjectile Parent. - [ ] Spawn Point Assigned: Ground spawn point transform linked in Projectile Attack ability.
- [ ] Projectile Count Set to 1: Prevents the enemy from ignoring minimum distance boundaries.
- [ ] Arc Trajectory Active:
Move in Arcenabled onRock Projectileprefab. - [ ] Trigger Delay Active:
Trigger Object Activatordelay set to1.5s to avoid self-collision. - [ ] Impact Particle Updated:
Stones HitFX assigned toImpact Effect Hit. - [ ] Cleanup Timers:
Destroy Enemy On Diechecked with a5s destruction timer.