i know that magnitude gets the middle of part only and if the parts square u can make it if magnitude < 10 but what if the part is rectangle and u trying to find if player in that rectangle part? How will i do that?
COMMUNITY QUESTION
use magnitude to see if player is inside a part that's a rectangle?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

7 comments
Maybe surround the rectangle with multiple parts on the sides and try to find their magnitudes? This was the quickest answer i could come up with from the top of my head, sorry if it doesnt help lol
Magnitude won't work properly as it will end up being a circle, not a square, in shape. This is simply by the nature of loci (fancy maths word for a maximum distance from a point). Do some Vector3 math or use Region3 to do this instead.
Could use .touched XD. No math, just a simple event.
Yeah, but then the player could walk out afterwards, and the event would have already been fired.
.Touched is laggy and dont get anchored blocks
How is it laggy? It is like asking someone a favor. If you ask someone to tell them when they wake up, you won't need to check frequently.
Have you taken the size of the part into account? I'm not sure which dimensions you used for your rectangle, but for my example I'll assume x and z. You would want to compare the magnitude of the x position + the x size of the rectangle, and do the same thing with the z axis. There is also a built in function called TouchEnded, which you could use to undo your Touched effect when the player leaves