Trying to animate a GUI but nothing is happening and there are no reportable errors

I’m trying to animate a GUI to come onto the display. Whenever I click the button, there are no errors and GUI does not move at all. I’ve never animated a GUI before and I primarily learn off reading and correcting errors, so that’s unfortunate. Any help is greatly appreciated!

wait(1)

local button = script.Parent
local on = false
local musicgui = game:GetService("StarterGui").MusicGui.Background

function click()
	if on == false then
		on = true
		musicgui:TweenPosition(UDim2.new(0.022, 0, 0.749, 0),"Out","Bounce",1) 
	else
		on = false
		musicgui:TweenPosition(UDim2.new(-1, 0, 0.749, 0),"Out","Bounce",1)
	end
end

script.Parent.MouseButton1Click:connect(click)

You are trying to adjust the starter gui version (where the game copies from to insert it into playerguis) instead of the players copy. The one you should be adjusting is under game.Players.LocalPlayer.PlayerGui

2 Likes

Would that mean I have to change the script into a LocalScript?

When adding scripts into UI in the first place, you always use local scripts. Since UI is normally used on the client’s side.

1 Like

Good tip, haven’t ever messed with UI so I’m pretty newbie with it. Thanks for the help!

1 Like