Devlog - Week 4 Tutorial


This week in our tutorial we were tasked to learn about NavMeshs, some basic AI and raycasting

Navmeshs are basically mapping a world or a Level (scene) out in a way that AI (called agents) can navigate around, it maps out where these agents can walk and what they are able to jump off of.

 First we created the Navmesh in our scene, we were supposed to use the world we had created from self-study 3 if it was suitable but i thought it was not so i downloaded the sample one. Once we had created the navmesh in the scene we then had to implement the AI (the agent) and get them moving around the scene based on the Navmesh which was pretty straighforward.

Once the Navmesh was implemented as well as the agent, we had to get this agent to move around the scene which we did by casting a raycast out to a point in the scene by clicking on a point, and then the agent would move to that point.. A raycast is basically a straight line that starts at an origin point and goes until infinite, keeping track of every object it hits a long the way. As we took the raycast by clicking on a point on the screen, the ray would be cast from the camera in the scene towards the spot that was clicked and then the first object it hit would be where the destination of the agent would go.

Finally after the agent was moving, our final thing to learn was about creating obstacles in the navmesh that could block spots where the agent could go. This part was simple and basically we just placed a cube infront of a drop off and remake the navmesh - resulting in a spot that the agent could drop off would no longer be able to drop off.

After all of the learning we were tasked with some exercises which were: adding a moving obstacle in the scene that would block the agents but not all of the time(i created a door that moved back and forth), create some raycast code that would actually spawn these agents by clicking on a point and then instead of them moving by clicking, they would automatically chase the player avatar around by raycasting (shown below) and lastly animating the agents so that they have the same model and animations that i created last week. 

Here are some Gifs showing off my exercise tasks: 

The spawning of agents by clicking on a point in the scene:


Agents following the player around: I couldnt record a long GIF and upload it here but as you can see they start moving towards the player.


Thanks for reading my Devlog

Nathan

Leave a comment

Log in with itch.io to leave a comment.