public

Rpg Maker Developers Group

Simple enough for a child, powerful enough for a developer

3 Followers

How can I draw a line from point A to point B and check if it overlaps a player?

BMM_Archive · July 15, 2026

BMM_Archive
Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.

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

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:

stealthSystem_s2.png

stealthSystem_s1.png

 

//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

RPG Maker Web attachments are mirrored locally when available. Other external links remain hosted by their original creator or third-party service.

  • Local mirror: 1836-a91ab33fdcfa84aa4008fddedc150699.png
    SHA-256: 58c4b6a5d38011e5da0b8604e43b084cf28939866a72f030cd777a82f18c7359
    Original attachment URL: https://forums.rpgmakerweb.com/attachments/stealthsystem_s2-png.7663/
  • Local mirror: 1835-5b674f27fdbc6be3274d9291a16bf3a3.png
    SHA-256: db804d6d9694ca105cf595fe5e32c59f24be03af16691cec9eefa3df3bff9d59
    Original attachment URL: https://forums.rpgmakerweb.com/attachments/stealthsystem_s1-png.7662/

Referenced Images / Attachments

stealthSystem_s2.png
stealthSystem_s2.png
stealthSystem_s1.png
stealthSystem_s1.png
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.

0 replies 23 views

Log in to reply.