Imagelabel not tweening

I made a card selecting feature using the scroll wheel, but when i scroll the cards dont change size, as they should heres the script:

card.Changed:Connect(function(value)
	if lastcard ~= nil then
		lastcard:TweenSize(CardNotSel)
	end
	local CardSelected : ImageLabel = cards:GetChildren()[value]
	CardSelected:TweenSize(CardSel,Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,1)	
	print(lastcard)	
	lastcard = CardSelected
end)

robloxapp-20230324-2344448 heres some footage
and also there are no errors in output, any fix?

So, what do you mean by scroll the cards?

mouse.WheelBackward:Connect(function()
	if card.Value ~= 2 then
		card.Value -= 1
	end
end)

mouse.WheelForward:Connect(function()
	if card.Value ~= maxcards then
		card.Value += 1
	end
end)

heres how it works
also the value changes accordingly

Got it, I would use a for loop, for i, card in pairs(-- All cards:GetChildren()) do, then check the i value and if the i value = the card value then you tween said card.

1 Like

I found a solution myself, thanks for giving advice!

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