KIT207 Devlog - Week 4, Tutorial 3: The Local Inhabitants
KIT207 Devlog - Week 4, Tutorial 3: The Local Inhabitants
The next modification to the tourist scene was to add simple moving AI agents, and the framework to support them.
Firstly, the Navigation window was opened and a new Navmesh was baked. This essentially makes a map that gives agents knowledge of where they can walk (I put an invisible ramp over the stairs for this part to work). The Off-Mesh links were enabled for these objects, which would allow the agent to jump between the main raised platform and the separated cube.
Next, the agent’s movement functionality needed to be coded, but conveniently the outline was supplied on the Tutorial page. The script takes the spot where the mouse is and shoots a beam (raycast) through the objects in that direction. Where this beam first hits an object is where it tells the agent to move towards. The Navmesh system does all of the rest of the work with pathing and movement to reach the end point.
But screw all that cool stuff, it’s frantic overhaul time! We make it so that clicking clones a new agent (from a prefab), and replace the mouse targeting script with a new one the aims towards a single given object instead. We import the third-person Unity starter pack and add the player related stuff into our tourist scene. We adjust the player object to better fit our scene and link it to our targeting script, so the agents now rapidly approach the player’s location. Finally for good measure, we whip up a spinning blue tile to do a bit of trolling on the raised platform.
Thank you for coming to my TED talk.
UTAS KIT207 Portfolio
Status | Prototype |
Category | Other |
Author | Linkyboy26XA |
More posts
- KIT207 Devlog - Week 5, Study 4: Group Project IdeasApr 05, 2024
- KIT207 Devlog - Week 5, Study 4: GamificationApr 05, 2024
- KIT207 Devlog - Week 3, Study 3: Shaping the WorldMar 19, 2024
- KIT207 Devlog - Week 2, Tutorial 1: Making a SceneMar 15, 2024
- KIT207 Devlog - Week 2, Study 1: Starting StrongMar 08, 2024
- KIT207 Devlog - Week 1, Study 1: Getting StartedMar 08, 2024
Leave a comment
Log in with itch.io to leave a comment.