Currently my game world consists of 32x32 tiles and the view is top-down. I have implemented pathfinding for enemy AI, but I only want AI to use it when they can't see the player. I have separate script that checks if a tilemap marked as collision is inbetween player and AI, but it only checks for one point (origin, which is bottom centre). Meaning if origin point can see the player but for example one of the edges is behind collision, AI gets stuck.
I thought I would check if points on the edges can see the player and then move on as needed. But I will have enemies sized 64x64 or 96x96 so those would have to have multiple checks along the edges to make sure they can follow the player. Is this kind of approach fine or is there a better way to do this?
I thought I would check if points on the edges can see the player and then move on as needed. But I will have enemies sized 64x64 or 96x96 so those would have to have multiple checks along the edges to make sure they can follow the player. Is this kind of approach fine or is there a better way to do this?