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

How Can I Find Out Where The Nearest Part Is?

Asked by 3 years ago
Edited 3 years ago

i don't know how i can make a player go to the nearest part, can somebody tell me how I can do that?

2 answers

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

I See You Can Use Is MAGNITUDE For Example

local Part1 = script.Parent
local Part2 = script.Parent.Parent.Part2
local Magnitude = (Part1.Position - Part2.Position).Magnitude
print(Magnitude)
-- To Test This Be Sure That The Script Is In The Part Or You Can Just Change The Part1's Path And Make Sure You Have A Part Called Part2 Or Again Change Its Path
Ad
Log in to vote
0
Answered by 3 years ago

I don't understand. What's your question?

Answer this question