Download presentation
Presentation is loading. Please wait.
1
Unity Game Development
AI Behavior & Navigation
2
Class overview Class 2 Revision Canvas UI Enums – Enemy States
NavMesh Baking NavMesh Agent Setting Enemy Patrols Range & Radius Checking Damage to Player Damage to Zombies
3
Revision Parenting objects in Hierarchy 2D Movement 3D Movement
Character Rotation to Mouse Position Prefabs (Bullets, Ammo Crates) Shooting & Spawning Bullets Canvas UI Targets! Applying Textures to Materials Advanced: Weapon Equipment Advanced: New Weapons
4
Canvas UI Use Canvas System to add UI elements on screen
Display Health & Bullet Ammo in Text
5
Enums – Enemy States Idle Patrol Chase Attack
6
NavMesh baking Window AI Navigation
Make objects Static in order to bake NavMesh
7
NavMesh Agent Setup Steering Settings Set Destination in code
Stop / Resume NavMeshAgent
8
Setting Enemy Patrols Save Origin
Swap between Target and Origin as NavMeshAgent Destination Advanced: use a list of multiple Targets for an advanced patrol setup
9
Range & Radius Checking
In “Idle” and “Patrol” states Search for the Player every Update. Visualize distance with Debug Gizmos For now we use a Radius (Sphere) to detect the player
10
Damage To Player Do a distance check (melee hit)
Add an attack cooldown Apply Damage and Reduce Health Play sound Reset Cooldown If too far away Chase player again
11
Damage To Zombies OnTriggerEnter check for “Bullet” tag
Destroy the Bullet Play sound Reduce Health Destroy Zombie if Health below zero
12
Q&A Do you have any questions related to the topics mentioned?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.