How to tell if a player is Inside?

Hey Developers,

How do I tell if a player is Inside a room without using region3? (Not under a brick, inside a room.)

add a part invisible part and can collide false and then use a touch event i guess this works

1 Like

that is incredibly innefficient however, and would not work 50% of the time.

do I just raycast from all directions of a player and if its hit on all directions then we know the player is in a room?

You will need some complicated raycasting on client for maximum efficiency. I am not exactly sure how the raycasting should be set-up. Most likely in a sphere-like manner or randomly.

You could create a part(s) that covers the room’s perimeter, and then place it underneath the room.

You could then use raycasting with a whitelist defined to those instances, and with a direction of -1 on the Y axis that extends far enough to reach the part positioned underneath the room.

I’ve used this for past work, really works like a charm and it’s pretty lightweight.

4 Likes