Help with tweening

Hello! For some reason, this won’t tween even though its being activated can someone help?

	local Notify = MainGui:WaitForChild("Notify")
	
	if answer == "Open" then
		Notify:TweenSize(UDim2.new(0.5, 0, 0.169, 0), "Out", "Quad", 1)
		--{0.444, 0},{0.169, 0} tip size
		Notify.Main.Text = " "
		print(Notify.Main.Text)
	elseif answer == "Stay" then
		Notify.Main.Text = "message"
	end
end)
1 Like

Is the answer Open and are there any errors in output?

I believe that you need to play the tween. Maybe try:

Notify:TweenSize(UDim2.new(0.5, 0, 0.169, 0), "Out", "Quad", 1):Play()

Players.BasicUserID.PlayerGui.LocalScript:91: attempt to index boolean with ‘Play’

did not work

You don’t play TweenSize/TweenPosition tweens

Whats answer right now and are there any errors in output?

Can you provide specific instructions? How does this source work? What’s the objective? I’m confused of what part of the code must activate.

1 Like

its getting a event fire from the server with a message and command and if its true then it will tween the size of a tip bar

Have you tried printing a message in every part of the code?

yes it works up to the tween :grinning:

You have to use Enums when specifying EasingStyle and EasingDirection in your tween parameters (same applies to TweenInfo):

Currently, they are strings in your code, switch them to Enums, like this:

Notify:TweenSize(UDim2.new(0.5, 0, 0.169, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 1)

If your code still doesn’t work after applying the change, try playing the tween outside of the function, if it works, there’s something wrong with your function.

Edit: Turns out you can substitute Enums with strings, learnt something new today, thanks @112365595!

1 Like

thanks it did not work so ima look into my function

No you don’t need to use Enums what you on about? You can substitute it for strings infact i think you can substitute any Enum for a string.

1 Like

??? what do you mean :confused:

Put this line of code before your if statement, to check if answer == “Open”:

print(answer)

it printed “Open”

and printed print(Notify.Main.Text)

A couple of debugging steps:

  1. Check if the size you’re tweeting it to is the size that the GUI is already at
  2. Check if the GUI is visible
  3. Check if the GUI is covered/overlapped by another GUI

Change this:

For this:

Notify:TweenSize(UDim2.fromScale(0.5,0.169))

Change something?

:confused: did not work sorry maybe its bc my gui is too small or soemthin

I don’t think size is the problem. What’s the classname of Notify?