I’m trying to make a custom proximity UI using player:DistanceFromCharacter but the prompt isn’t appearing when I have reached the desired position (~10 studs away)
-- LocalScript "Core"
for i, v in pairs(workspace:GetDescendants()) do
if v:FindFirstChild("ProximityUI") then
if Settings:GetDistanceFromCharacter(
game.Players.LocalPlayer, Vector3.new(v.Position.X, v.Position.Y, v.Position.Z)) <= 10 then
v.ProximityUI.Enabled = true
else
v.ProximityUI.Enabled = false
end
end
end
-- ModuleScript "GameSettings"
function settings:GetDistanceFromCharacter(player, point)
return math.round(player:DistanceFromCharacter(point))
end