MaxActivationDistance is not a valid member of ClickDetector

  1. What is the issue? i tried to disable a clickdetector locally but there is an error

  2. What solutions have you tried so far? changing the parent of the clickdetector to nil

local egg = game.ReplicatedStorage:WaitForChild("Assets"):WaitForChild("Egg")

local click = game.Workspace.Egg:WaitForChild("Part"):WaitForChild("ClickDetector")

local camera = Instance.new("Camera")
camera.CFrame = CFrame.new(egg.Position + (egg.CFrame.LookVector * 5),egg.Position)

local eggviewport = script.Parent.Main:WaitForChild("ViewportFrame")
eggviewport.CurrentCamera = camera
egg.Parent = eggviewport

game.ReplicatedStorage.HatchEgg.OnClientEvent:Connect(function(pet)
	eggviewport.Visible = true
	click.MaxActivationDistance = 0
	wait(1)
	click.MaxActivationDistance = 32
	eggviewport.Visible = false
end)

MaxActivationDistance is most definitely a field of ClickDetector, and you haven’t misspelled it, so the fact that you are getting this error means that there is probably something else called “ClickDetector” that isn’t actually a ClickDetector.