I’ll get right into the problem; the click event just doesn’t fire. I only have this in the entire script:
script.Parent.ClickDetector.MouseClick:Connect(function()
print('clicked')
if #workspace.AI:GetChildren() >= 5 then return end
local AI = game.ReplicatedStorage.AI:FindFirstChild(script.Parent.Name):Clone()
AI.Parent = workspace.AI
AI:SetPrimaryPartCFrame(workspace["Practice Gym"].Court.GameObjects.AISpawn.CFrame)
end)
The clicked print won’t even work and I don’t think the event is even firing.
Image of my explorer:
The only thing I can think of that is interfering is that the surface gui is somehow blocking the clicks.
Before anyone asks:
MaxActivationDistance is set to 32.
The properties are the default ones.
The cursor appears like I can click it but the event never fires.
Its not printing at all, I don’t exactly understand how its set up wrong though. I tried using wait for child and variables but that didn’t give any different results…
I think I might have figured it out. My game uses context action service to bind something to the MouseButton1, I think the click detector won’t work due to that. Guess I’ll have to figure out a method to bind and unbind it throughout gameplay.