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?

7 comments

0

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

0

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.

0

Could use .touched XD. No math, just a simple event.

0

Yeah, but then the player could walk out afterwards, and the event would have already been fired.

0

.Touched is laggy and dont get anchored blocks

0

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.

0

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