Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago

I would like to know if there is a way to check the distance between your HumanoidRootPart and other bricks in the game. If there is please help guide me in that direction. I am not asking for a script.

0
https://wiki.roblox.com/index.php?title=API:Class/Player/DistanceFromCharacter Where the Vector3 is, put your brick's position MooMooThalahlah 421 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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.

0
I forgot a reference, but here it is. https://wiki.roblox.com/index.php?title=Magnitude Ultimate_Piccolo 201 — 6y
1
would you be able to do this with multiple parts? MyTradeJustWentViral 5 — 6y
0
iterate through them headshotiwnl 0 — 3y
Ad

Answer this question