Tutorial 3
This tutorial was about Navigation.
To start off with, I baked a NavMesh over my terrain / platforms. This represents the area that AI characters (agents) can travel across.
The NavMesh for my scene. The lines connecting between blue mesh represents 'jumps'.
I also made sure to include the obstacle cubes so that AI avoids it.
Space around the cubes means the agents won't bump into it.
With all this set up, I could create agents to use the mesh. I decided to make these agents into mini-me(s), as I had already made the animations. To control the agents, I used ray casts to direct them where I click in the game environment.
My minion army.
Minion dance party.
I also created a moving sphere to act as an obstacle, then added a "Nav Mesh Obstacle" component so that the AI treats it as such.
Moving sphere.
Epic dodging.
The final task was to create enemy AI that stalks the player. I repurposed the agent click navigation script to instantiate an enemy prefab at the mouse click location and also made a script for the enemy that moves it towards the player and always makes it face them.
Click for enemy.
Run away!
This was a fun tutorial that has a lot of potential to use in the game project later this semester.
Get UTAS KIT207 Portfolio
UTAS KIT207 Portfolio
Status | In development |
Category | Other |
Author | corey_bigboi |
More posts
- Tutorial 5Aug 17, 2022
- Self Study 5 - Lighting + ShadersAug 15, 2022
- Game IdeasAug 09, 2022
- Self Study 4: A Simple GameAug 07, 2022
- Self Study 3: Terrain TimeJul 30, 2022
- Tutorial 2Jul 27, 2022
- Self Study 2: Modelling, Rigging, and AnimatingJul 26, 2022
- Tutorial 1Jul 20, 2022
- Self Study 1: Barrel + Tasmanian Tourist AttractionJul 17, 2022
Leave a comment
Log in with itch.io to leave a comment.