Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is there any way to check the distance between you and a brick?

1 answer

✓ Accepted answer

There is a way. By using magnitude you can find the distance between a character's HumanoidRootPart and another brick in workspace.

Basically, all you have to do to get the distance is this

local distance = (workspace.Player.HumanoidRootPart.Position - workspace.Part.Position).magnitude

This will give you a distance in studs.

3 comments

0

I forgot a reference, but here it is. https://wiki.roblox.com/index.php?title=Magnitude

1

would you be able to do this with multiple parts?

0

iterate through them

This discussion is preserved as it was. New answers, comments, and votes are closed.