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

Script isnt detecting updates via GetPropertyChangedSignal()?

Asked by 2 years ago

I'm making a custom proximity prompt system and I'm trying to detect when a player moves, then to check if they're close enough to see/use the prompt.

This is a test scrip that is supposed to detect movements:

local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)

    Player.CharacterAdded:Connect(function(Character)

        local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
        HumanoidRootPart:GetPropertyChangedSignal("Position"):Connect(function()

            print(tostring((HumanoidRootPart.Position - script.Parent.Position).Magnitude))

        end)

    end)

end)

I have also noticed it detects the first 1-2 changes, then doesn't detect anymore.

Does anyone know what's wrong?

0
I thought it was GetPropertyChangedSignal with no brackets.. MrSmartyPants126 0 — 2y

Answer this question