My journey becoming a Unity game developer: Enemy AI-Setup the guards to patrol the area (Part 6)

Darren detected and captured
Waypoints added and positions modified for each of the guards paths.
Player has a Layer created for the guards rays to focus on.
Using raycast for the guards to detect the player.
Rays being shown when the guard detects Darren.
Substituted SphereCast for Raycast with a radius representing the guard’s view.
SphereCast detecting Darren easier than Raycast for the guard.
Eye game object created and scaled to represent the view of the 1st guard.
Eyes game objects duplicated with component values pasted for the other 2 guards.
Eyes game objects Is Trigger turned on and script attached.
Rigidbody added to trigger the Eyes game objects.
Darren detected by the guards and game over cutscene plays.
Capture cutscene fade in adjusted to take a little longer.
Main Camera position changed from adjusting the game over cutscene.
Main Camera position and rotation attached to the Start Camera.
Main Camera position fixed to start the game.




Learning to become a Unity game developer.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Giant Squid: Day 4: Advent of Code 2021 — Solution

GitHub Actions 101 Finale: Build Your Custom Action

A New Web Developer’s First Brownfield Experience

Command Injection in Rails

Flatiron Sinatra Project! Finally finished and how it beat me up.

Creating and Deploying pods

How to use your Ledger hardware wallet with SORA network and

KM Component 48: E-learning

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rhett Haynes

Rhett Haynes

Learning to become a Unity game developer.

More from Medium

My journey becoming a Unity game developer: 2.5D

In just 4 steps, Make a modular moving platform in Unity

Set Lasers To Destroy

How to the Layered Lit shader to mix Texture Maps in Unity HDRP