So I'm trying to make a detection system on my own and I want my guards to draw lines in front of them and if any line collides with the player then the player is seen. The thing is I want the lines to hit unpassable objects (so it doesn't go through walls) but go through stuff like chairs and tables, so I'll probably use region IDs for that. Can anyone give me a hand/direction on how to do such a function?
I'm thinking of something like:


//On GameEventcan_see_player?(disX, disY) for i to n line = drawLine() if(line.overlaps($game_player)) return true; end end return false;endJust tossing ideas really. If anyone can give me a hand/direction I'd be very happy 🙂
Thanks in advance
I'm thinking of something like:


//On GameEventcan_see_player?(disX, disY) for i to n line = drawLine() if(line.overlaps($game_player)) return true; end end return false;endJust tossing ideas really. If anyone can give me a hand/direction I'd be very happy 🙂
Thanks in advance