Charging Attack
This guide details how to configure the Charging Attack combat ability for the Bull Boss New AI entity. It covers movement parameters, animation configuration, damage/knockback colliders, manual camera shake triggers, and animation event-driven footstep audio.
1. Overview & Ability Configuration
Add the Charging Attack ability to the boss's Phase 0 ability list and configure its target tracking and movement speeds.
Steps
- Select the Bull Boss New GameObject in the hierarchy.
- Scroll down and expand the Combat Attack System component.
- Under Phase 0, click Add Ability Entry to Group.
- Set Ability Type to Charging Attack.
- Set Charging Attack Probability to
100. - Set all other previously created ability probabilities to
0for focused testing. - Configure movement parameters:
- Move Speed:
5 - Look Mode:
Target - Move Towards Target: Checked
- Should Apply Root Motion: Unchecked
- Idle Delay:
0
2. Animation Import & Setup
Download the run animation, set up humanoid rigging, and bake it.
2.1 Importing & Rigging Animation
- Go to Mixamo, search for the
Mutant Runanimation, and download it for Unity (With Skin). - Import the downloaded
.FBXfile into Unity. - Select the imported asset and set Rig Type to
Humanoid, then click Apply. - Open the Animation tab in the inspector:
- Check Loop Time.
- Check Loop Pose.
- Set Based Upon to
Original. - Click Apply.
2.2 Binding to Boss Animator
- Select Bull Boss New and locate the Animation Setup Tool in the inspector.
- Drag and drop the
Mutant Runclip into the animation slot. - Set the parameter name/label to
Run. - Click Add to Animator and click Optimize Animation Clips.
- (Optional) Delete the imported Mixamo FBX asset from the project folder.
- In the Charging Attack ability parameters on
Bull Boss New, set Move Animation toRun.
3. Charging Collider & Knockback Trigger
Create a dedicated trigger volume to deal contact damage and knock back the player when hit during the charge.
Steps
- Right-click Bull Boss New -> Create Empty and name it
Charging Collider. - Add a Capsule Collider component:
- Adjust radius to fit the front profile of the boss.
- Check Is Trigger.
- Add the Knockback Trigger script component.
- Assign excluded colliders to avoid self-collision:
- Lock the Inspector window.
- Drag the main Bull Boss New collider, the weapon's Damage Point collider, and the Charging Collider itself into the Enemy Colliders array.
- Unlock the Inspector.
- Set Collision Damage to
10. - Ensure Destroy on Hit is Unchecked.
- Assign
Charging Colliderto the GameObject to Activate field in the Charging Attack ability inspector. - Deactivate the
Charging ColliderGameObject by default in the hierarchy.
4. Distance & Forward Drive Behavior
Configure how close the boss gets before locking its trajectory and rushing forward.
Steps
- In the Charging Attack ability inspector, set parameters:
- Stop Chasing Target Distance:
5 - Move Forward After Stop Chasing: Checked
- Forward Distance:
20
Behavior Description: When the player distance is 5 meters, the boss stops rotating to face the player and locks into driving straight forward for an additional 20 meters. Setting the chase stop distance to
0would make the boss continuously move towards the player.
5. Camera Shake Setup (Manual Triggering)
Configure a camera shaker trigger that activates when the charge begins and stops when the charge ends.
5.1 Manual Shaker Configuration
- Duplicate your existing
Camera Shake TriggerGameObject. - Rename the new object to
Camera Shake Trigger Manual(and rename the previous automated one toCamera Shake Trigger Automaticfor clarity). - On
Camera Shake Trigger Manual, set Control Mode toManual. - Set Oscillation Speed to
3. - Set Return Duration to
2.
5.2 Event Hook Binding
- Select Bull Boss New and scroll to the Event Hook Listener section.
- Add two event hooks:
- Hook 1: Select Event
On Ability Start.- Target: Drag
Camera Shake Trigger Manual. - Function: Select
CameraShakeTrigger -> TriggerShake.
- Target: Drag
- Hook 2: Select Event
On Run Stopped.- Target: Drag
Camera Shake Trigger Manual. - Function: Select
CameraShakeTrigger -> StopShake.
- Target: Drag
6. Footstep Audio via Universal Sound Player
Sync movement audio to exact run animation frames using Animation Events.
Steps
- Select Bull Boss New and locate the Universal Sound Player component.
- Assign footstep clips (e.g.,
Gravel SteporMud Step). - Set sound properties:
- Volume:
1 - Is 3D Sounds: Checked
- Max Distance:
20 - Copy the Action Name corresponding to the footstep audio entry.
- Open Window -> Animation -> Animation with
Bull Boss Newselected. - Select the
Runclip from the animation dropdown. - Add Animation Events at the exact frames where the boss's feet hit the ground:
- Function: Select
UniversalSoundPlayer.PlayAudioAction. - String Parameter: Paste the footstep Action Name.
7. Testing & Verification Checklist
- [ ] Probabilities: Charging Attack set to
100%, all other abilities set to0%. - [ ] Collider State:
Charging Collideris deactivated by default in the hierarchy. - [ ] Self Collision: Enemy Colliders array includes boss body, weapon point, and charging collider.
- [ ] Camera Shake: Shake starts automatically on
On Ability Startand stops onOn Run Stopped. - [ ] Audio Sync: Footstep sounds play in time with the running animation frames via the Universal Sound Player.