Smart Turning Behaviour
This guide demonstrates how to configure turning animations and target detection parameters on the Bull Boss enemy using the Boss AI Toolkit
1. Overview & Key Concepts
- Team Member System: Manages target detection and determines hostile vs. friendly entity relationships based on Team IDs
- Enemy Vision Angle: Sets the field-of-view threshold (e.g., 45, 60) required to trigger turn animations
- Mixamo Animation Workflow: Importing, configuring Humanoid rigs, and assigning root motion turning clips
2. Setup Guide
Step 1: Target & Team Setup
- Select the
Bull Boss NewGameObject in your Unity hierarchy - In the Inspector, navigate to Enemy Ability System.Expand Global Settings to locate the
Team Memberscript - Configure team relationships:
- Bull Boss: Set
Team NametoTeam2 - Player: Set
Team NametoTeam1
!!! NOTE "Team Relationship Rule"
If both entities share the same team name (e.g., Team 2), they are treated as friendly and will not attack each other Differing team names establish hostility
- Assign target body parts (
My Body Part to Target) for hit registration - Set
Target Detection Rangeto100 - Check Auto Update Target (scans for nearby targets every 0.5–2.0 seconds)
- Uncheck Log Sorted Enemies
Step 2: Rotation Settings
Under Global Settings, configure the following properties:
- Detection Range: Set to
100(matches the Team Member script) - Enemy Vision Angle: Set to
45 - Initial Search Delay: Min
1, Max2seconds - Rotation Check Interval:
2 - Rotation Speed:
1000
Enable the following checkboxes: - [x] Control Rotation - [x] Use Rotation Animation - [x] Always Look at Target - [x] Rotate Spine Bone
Step 3: Mixamo Animation Setup
- Search Mixamo for "Mutant Turn"
- Download Mutant Right Turn 90 (
Unity format,With Skin) - Toggle the Mirror checkbox on Mixamo to flip the clip, then download the Left Turn animation
- Drag both
.fbxfiles into your Unity project - Select both animation files and configure their Inspector settings:
- Rig Tab: Set Animation Type to
Humanoidand Click Apply - Animation Tab:
- Rename clips to
Right TurnandLeft Turn - Set Based Upon (Root Transform Rotation) to
Originaland Click Apply
- Rename clips to
Step 4: Link Clips to Animator & Script
- Select
Bull Boss Newand expand Animation Setup Script and Add Animation - Drag
Right TurnandLeft Turninto their respective slots - Assign parameter names:
- Right Animation
Right Turn - Left Animation
Left Turn - Click Add to Animator Controller and Optimize Animation Clips
- Under Rotation Animations, map the directions as follows:
| Setting | Right Direction | Left Direction |
|---|---|---|
| Direction | Right | Left |
| Rotation Animation | Right Turn | Left Turn |
| Idle Animation | Idle | Idle |
| Use Root Motion | Enabled | Enabled |
| Animation Duration | 2 seconds | 2 seconds |
!!! Tip "Auto Duration" Click Auto Get Length to automatically populate the animation duration from the clip
3. Testing Vision Angles
| Vision Angle | Behaviour Summary |
|---|---|
| 45 Degrees | Tight Response: The boss turns rapidly as soon as the player leaves its 45 Degrees, triggering quick micro-adjustments |
| 60 Degrees | Forgiving Margin: The player has a wider arc to maneuver without triggering turn animations, reducing overall turn frequency |