Issue with Billboard GUI buttons not working consistently

  1. What do you want to achieve?
    I want to resolve an issue with the buttons in my Billboard GUI that only work sometimes and ensure they work consistently.
  2. What is the issue?
    I have created a Billboard GUI with buttons that are supposed to trigger specific actions when clicked. However, the buttons only work sometimes and are not consistent in their functionality. I have attached a video demonstrating the issue.https://gyazo.com/d9923728727627e7ccaf960536f84a01
  3. What solutions have you tried so far?
    I have tried troubleshooting the issue by reviewing my code and ensuring that it is correctly written. I have also looked for solutions on the Developer Hub, but have not found any that address this specific issue. I have also tried adjusting the placement of the buttons to see if that would affect their functionality, but it did not help.

Here is my code:

local player = game.Players.LocalPlayer
local RS = game:GetService("ReplicatedStorage")
     
while wait() do
	for _, v in ipairs(script:GetChildren()) do
		if v:IsA("BillboardGui") then
			if (v.Adornee.Position - player.Character.HumanoidRootPart.Position).Magnitude <= 15 then
				v.Enabled = true
			else
				v.Enabled = false
			end
		end
	end
end

Any help with this issue would be greatly appreciated. Thank you!