Why is my third ability different from my other two

in the way how the UI darkens when I hover over it and any image i put on the new ability overlaps with the text
I’ve scripted it the same way so why are these errors showing?

1 Like

It’s hard to say exactly because there is just so much we don’t know. It could be something as simple as something not being marked visible in the other two. Or something more complex such as you terminating without warning when a condition required to make it darker fails.

To truly help you would likely have to show us the explorer panel for these and the code. (And check the properties, but giving us those too would likely be too much)

1 Like

Check the properties window:

Screen Shot 2024-12-28 at 9.43.24 PM

Turn off AutoButtonColor.

2 Likes

image
This is the comparison between the two abilities, where ‘Manage Equipment’ lacks a value named ‘Sentry’

By the way, all three buttons are made from the same button template, shown below
image

showing a template UI that looks like this
image

btw all ability buttons are made from the same script looping through each ability, and duplicating the template

for i, attack in pairs(weapon.Abilities:GetChildren()) do
		local attackConfig = attack:GetAttributes()
		local button = gui.Abilities:FindFirstChild(attack.Name)

		-- If the abilities' settings aren't set in their buttons, then this will run to fill the button's settings
		if not button then
			button = gui.Abilities.Template:Clone()
			button.Name =  attack.Name
			button.Image = attack.Image.Texture
			button.Ability.Text =  attack.Name
			button.Visible = true
			button.Parent = gui.Abilities
		end

		gui.Abilities.Visible = true
end

so it is strange why one button could be different so it may be a property issue. If you need more info, just let me know!

1 Like

This solves the issue of the UI darkening when I hover over it, but doesn’t solve the other issue of the image overlapping with the text for new UI

i’ll give you a heart thank you

1 Like

You can use the ZIndex property of GUI elements to adjust the order they render. A higher ZIndex means it will render on top, so try setting the ZIndex to be higher on the text inside the template, if this is what you mean.

1 Like

i guess you can adjust the Z-index but i dont want the image to fill the whole button which happens for the previous two but not this one