I’m writing a 2D top-down simulation game where I have agents wandering around (and inside) a number of buildings.
The “outside” was pretty easy to do, I added all the buildings to a particular layer, attached some colliders, generated a grid graph and everything’s working great.
What I want to do now however is ensure that agents which are INSIDE a building can only pathfind from one room to the next and never step outside - essentially, I’d like to somehow create a new grid which inverts the Collision testing (ie - only allow agents to walk within building layer objects).
I’ve tried to set the mask to the ground but that just made everything non-accessable, I also tried unchecking ‘use 2D physics’ and playing around with height testing but that just made everything accessable (might be because I’m using 2D).
Am I missing something obvious here? Thanks