Hello! I am currently wondering on what a good way to detect if a player has entered or left a Region3. I am thinking a while loop running every second to detect if the player entered, and whilst they’re inside the Region3, a while loop running every second to check if they left using magnitude. Is this a good way to do this, and if so, how would I check if they left with magnitude because this is my first time using magnitude if it’s a good way to do it. The Region3 isn’t really big, it’s fairly small, a little bit bigger than a default Roblox avatar in case you were wondering. Thanks!
What is a good way to detect if a player has entered/left a Region3?
Sorry but the question has been said before a lot of times, but yeah you are on the right track with region 3.
The Solution? Zone+…maybe but yeah the resource mentions a lot of alternative methods you can use with a shorthand version of the pros and cons of each method of defining a zone.
There’s a lot of good advice in this resource, I suggest checking it out:
Why not use a part for this? As long as you perform the touch checks on the client you can be confident they will return correctly when the player enters and leaves the area.
oh lmao sorry about that, ill read that post ty
i was thinking about a part but touch ended is unreliable
TouchEnded is reliable as long as you use it correctly on the client and the parts don’t get removed from the workspace. I use this to handle camera zones in one of my own places.
yeah but if i check on the client an exploiter can easily exploit that and for example teleport the part to themself
Sure, so you should also perform validation on the server.
Using Touched and TouchEnded on the client in general should be more performant however and would be my recommended method to detect the initial region enter.
oh yeah i forgot the server existed. im an idiot. ill try out the link that the other guy sent and a part and see which works better, ty for the help