How can I draw a line from point A to point B and check if it overlaps a player?
BMM Archive · July 15, 2026
Original Source
- Original title: How can I draw a line from point A to point B and check if it overlaps a player?
- Original author: IsFutureBright
- Original date: August 23, 2013
- Source thread: https://forums.rpgmakerweb.com/threads/how-can-i-draw-a-line-from-point-a-to-point-b-and-check-if-it-overlaps-a-player.17287/
- Source forum path: Game Development Engines > Ruby Game System (RGSS) Scripts > RGSS3 Scripts (RMVX Ace) > RGSS3 Script Requests
Summary
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: { "lightbox_close": "Close",
Archived First Post
I'm thinking of something like:
Protected download
Protected download
//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
Downloads / Referenced Files
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadReferenced Images / Attachments
Creator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
Topic Summary
Loading summary...

