Why wont my gui tween work?

30%20PM

The click is registering and its printing tweened but nothing is moving. Am i doing something wrong?

Any error or anything that could help me figure out your issue?

I was about to ask that I’ll give him an example code here

local Hover = {}

local sp = script.Parent
local TweenService = game:GetService("TweenService")
local TweenInfo = TweenInfo.new(0.1,Enum.EasingStyle.Bounce,Enum.EasingDirection.Out,0,false,0);

function Hover:Create(Button)
	
	Button.MouseEnter:Connect(function()
		local goal = {};
		goal.Size = UDim2.new(1, 36,1, 36)
		goal.Position = UDim2.new(0, -18,0, -18)
		TweenService:Create(Button.Theme,TweenInfo,goal):Play()
	end)
	
	Button.MouseLeave:Connect(function()
		local goal = {};
		goal.Size = UDim2.new(1, 24,1, 24)
		goal.Position = UDim2.new(0, -12,0, -12)
		TweenService:Create(Button.Theme,TweenInfo,goal):Play()
	end)

end

return Hover

I just re-read his code.
He’s doing the TweenPosition in the module and using TweenGui as a function

Yeah, he is but code is messy if you ask me.
He is not even replying to as to give us some more information :confused:.

I don’t think there’s anything wrong with his code.

@Vivid_Void, does the tween work if you do it outside of the module? If so then the issue is with the module, otherwise your tweening isn’t done correctly if that made sense.

We can go from there.
Also, try printing out the instance name in the module to see if it’s actually the gui and not nil.

1 Like

Like for example this is weird if it is loaded, why are we waiting for it?
image

Let me decode the code so

We get all children form the gui and we wait when they load if they are loaded why are we waiting.

But, my guess is that he forgot to change the number.
image

The tween does not work outside the module :frowning:

Are you supposed to be moving button and not v?

Im trying to get it to move to its parents position so im using Udim2.new(0,0,0,0)

What is the current position :confused: ?

yes im trying to move the button the v is the parent of the button(the image label)


This prob gives more context on what im trying to do by using udim2.new(0,0,0,0) im trying to move the button down to the image label

Use this, but change positions.

local TweenService = game:GetService("TweenService")
local TweenInfo = TweenInfo.new(0.1,Enum.EasingStyle.Bounce,Enum.EasingDirection.Out,0,false,0);

function Hover:Create(Button)
	
	Button.MouseEnter:Connect(function()
		local goal = {};
		goal.Position = UDim2.new(0, -18,0, -18)
		TweenService:Create(Button.Theme,TweenInfo,goal):Play()
	end)
	
	Button.MouseLeave:Connect(function()
		local goal = {};
		goal.Position = UDim2.new(0, -12,0, -12)
		TweenService:Create(Button.Theme,TweenInfo,goal):Play()
	end)

end

return Hover
6 Likes

Is there a problem with using :TweenPosition()?

Test what you have right now and see if it does move it (check the properties of the button). Maybe the button isn’t visible or something alone those lines.

1 Like

Okay give me 1 sec ill test it out

1 Like

I don’t recommend them(TweenPosition,TweenSize,TweenSizeAndPosition) to be honest TweenService is better.

  1. More Options
  2. Pause
1 Like

I tried it out and It works thankyou!

2 Likes