Hi, I want the TextButton to detect presses at the position of {0.5, 0},{0.95, 0} and the Anchor Point as 0.5, 0.5.
It works as intended until I set the scale on the Y axis of the position to anything below 0.7; none of the clicks are detected. If I hover over the button, it doesn’t change colour.
The button I’m talking about is the ‘EQUIP’ button below the text ‘Bubble Bunny’. This is in the StarterGui, the button with the errors is highlighted:
Here’s a video showing it happen:
Here’s a simplified version of the code for all the buttons:
local replicatedStorage = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
local player = players.LocalPlayer
local scrlFrame = script.Parent:WaitForChild("ScrollingFrame")
for i, button in pairs(scrlFrame:GetChildren()) do
task.wait(1)
local textBtn = button:WaitForChild("TextButton")
local bunnyName = button:WaitForChild("TextLabel").Text
if bunnyName == replicatedStorage:WaitForChild("EquippedBunny-"..player.Name).Value then
textBtn.Text = "UNEQUIP"
end
textBtn.MouseButton1Down:Connect(function()
print(button.Name,"clicked!")
if textBtn.Text == "EQUIP" then
for i, bunny in pairs(scrlFrame:GetChildren()) do
if bunny:IsA("ViewportFrame") and bunny.Name ~= "Starter Bunny" and bunny.Name ~= button.Name then
bunny:WaitForChild("TextButton").Text = "EQUIP"
end
end
textBtn.Text = "UNEQUIP"
end
end)
end
Thanks for reading, any help would be greatly appreciated!