Heya
Been trying to think of the best ways to do the following. I wanted a top down project where an npc can be clicked and ordered to move to a position if that gridspace is free. movement and everything is easy enough to set up with the pathfinding tool, but the area check is what's giving me pause.
Was wondering if, rather than having the npc move to mouse.x, mouse.y, instead I should spawn an invisible sprite that spawns in that grid space and acts as a beacon, remaining in that area until the npc either dies or moves to another area. that way, when you click to move an npc to an area, the beacon won't spawn in that area if there's already one in the space, and so the next npc can't move.
It seems a bit convoluted though, and I don't like that I'm effectively doubling the number of instances in the level by doing this.
It might also be better than the second npc can move in the general area of the first, and instead fill an empty space adjacent to the targeted area.
Is there a better way to handle this?
Cheers