Don't Walk By - 11

Don't Walk By - 11

Apr 3, 2020. | By: Evan Diamond
1 min

The eleventh CGD blog post about Don’t Walk By

Overview

I implemented this week the door system

Door system

Sometimes when the ai gets of the bus they do not go through the entrance doors and instead path along the grass to the exit.

ai on grass

To help deal with this I set up a pathToDoor function. This function finds the nearest internal doors to the ai and sets the ai to path to the point of the door’s position. Once they hit the door’s trigger a script on the door causes them to start their default behaviour and path to points of interest. I also set up an isInside bool which is checked by the script on the doors, if it’s true then the pawn is already inside and startDefaultBehaviour shouldn’t be called. Initially isInside was set to true when the ai hit a door’s trigger but it was changed being equal to if the ai was on an interior (true) or exterior (false) tile. It was changed to this because there where still times where the ai would decided to path along the grass even after hitting a door’s trigger. So when this happened pathToDoor would be called again forcing the ai to go to the door. This still didn’t completely get rid of the issue so I decided to set the grass tiles to be unpathable using the tile system. This caused the ai to be unable to walk along the grass at all.

ai at door

There’s still issues with the system but the ai has stopped walking on the grass.

About

Gamers developing new games.

Social Links

Our Bunker

University of the West of England,
Frenchay Campus, Bristol, BS16 1QY,
United Kingdom.