Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Tween Not Working-Unable to Cast Value to Function?

My GUI tween keeps coming up with the error Unable to Cast Value to Function. Any help to fix this issue would be much appreciated.

Here is my code:

local creditsButton = script.Parent.Parent:WaitForChild("CreditsButton")
local changelogButton = script.Parent.Parent:WaitForChild("ChangelogButton")
local playButton = script.Parent.Parent:WaitForChild("PlayButton")
local gameTitleLabel = script.Parent.Parent:WaitForChild("GameTitleLabel")


local function hidePlayButtonTween()
	
	playButton:TweenPosition(

		UDim2.new(1, 0, 0.326, 0), --End Pos
		"Out", --Easing Direction
		"Sine", --Easing Style
		1, --Time
		false, --Override Other Tweens
		false --Callback
   )
end



creditsButton.MouseButton1Up:Connect(hidePlayButtonTween)
creditsButton.TouchTap:Connect(hidePlayButtonTween)

1 comment

0

Nerd.

1 answer

The last parameter for TweenPosition is looking for a function, you gave it a boolean value. nil would be correct, I believe. nil tells the TweenPosition method that there is no callback function

This discussion is preserved as it was. New answers, comments, and votes are closed.