so, im making a waypoint system for my open-world game but the distance meter won’t work, here’s how it looks like: (screenshot made while testing)
the Vector3.Magnitude does not work, AT ALL.
LocalScript:
while wait() do
script.Parent.Text = (game.Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid").RootPart.Position - script.Parent.Parent.Parent.Position).Magnitude
end
first attempt was to use GetBoundingBox().Position, but didn’t work.
again, this is a LocalScript so i don’t know if it’s even supposed to work
if anyone knows the solution, please tell me.
localscripts wont run in workspace, try placing it in starterplayercharacter or starterplayerscripts
this does mean that youll have to change script.Parent.Parent.Parent though
What you might prefer is to place the BillboardGui in the player’s PlayerGui and assign the Adornee to the part. You can then reference the part via the Adornee property
game.Players.LocalPlayer.CharacterAdded:Connect(function(char)
game:GetService("RunService").RenderStepped:Connect(function()
if char ~= nil then
for _,v in pairs(workspace.WaypointStorage:GetChildren()) do
local label = v:FindFirstChild("Distance").TextLabel
if label and v:IsA("BasePart") then
local mag = (char:FindFirstChildOfClass("Humanoid").RootPart.Position - v.Position).magnitude
label.Text = math.ceil(mag)
end
end
end
end)
end)
and now it stops working upon respawn, and the output is empty