Posted August 09, 2022 by Ove_frode
Tutorial 3:
This week we were tasked with learning the ins and outs of NavMesh, which allows you to map out the environment, so we don't have to run expensive pathfinding calculations.
For this task, I started by using the tutorial sample scene, and after mapping the scene out, I had the brilliant idea of creating a sort of floor lava, as shown below.
After laying down the navmesh with the drop height and jump distance set, the model could move and, more excitingly, fall with style!
Showcases movement and "jump/falling":
After setting up the navmesh, we were tasked to add objects to the scene that our Player had to go around.
showcase the pathfinding around objects:
Simple Game and Ideation:
After getting the main functions down, I decided to add this to my project settings. At first, needed to make the "enemy" different from my Player. To do this, I made a copy of the players base model and then changed the RGB, so the goblin's skin became red (green good, red bad Simple Smiles)
After setting the spawners to spawn a set number of the red goblins, I needed to make it, so they followed/chased the Player.
Showcases the red goblins chasing the Player:
After the red goblins were chasing the Player to make it a little more game like I added the Health to the game, so the Player has 10 HP, this number is changeable.
Showcases the Health:
After getting the Health to work, I needed a way to kill the red goblins, so after adding a trigger effect to the red goblins, I could make it so if the Player runs into a red goblin, they die.
Killing goblins works, but Health is still working on
Sadly the decreased health function has been playing up. I threw in a lot of debugs to try and work out the problem.
Until next time.