Why isn't my tween playing?

Tween function fix.

[code removed]
1 Like

Try changing this

local SizeTweenDecrease = TweenService:Create(script.Parent:WaitForChild("ImageLabel"), SizeDecreaseInfo, SizeDecreaseGoal)	

into this

local SizeTweenDecrease = TweenService:Create(script.Parent.ImageLabel, SizeDecreaseInfo, SizeDecreaseGoal)	
1 Like

This doesn’t change anything. – Just stops it checking if ‘ImageLabel’ exists.

I noticed your MouseLeave connection is nested inside your MouseMoved connection. You should move the MouseLeave code block outside because right now you are establishing a new connection every time the mouse moves, which will result in MouseLeave firing multiple times at once.

Cheers, I’ll adjust the script to see if this makes a difference.

Where would i move it to? I tried a few different places and it didn’t work.

Just move it outside of the MouseMoved function like so:

script.Parent.MouseMoved:connect(function(x, y)
	...
end)

script.Parent.MouseLeave:connect(function()
	...
end)

Also looking closer at your code, I realized you are using MouseMoved instead of MouseEnter? That’s causing SizeTweenIncrease to play every time the mouse moves which is probably why SizeTweenDecrease isn’t working because it’s getting canceled by the increase tween with every mouse movement.

I want to actively track the mouse location which is why i’m using MouseMoved.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.