Hello. I am writing some scripts and while editing TweenPosition I had an error.
CODE:
local Inventory = script.Parent.Parent local CloseInventory = script.Parent CloseInventory.MouseButton1Click:Connect(function() Inventory:TweenPosition( UDim2.new(0.459, 0,1, 1), "OutIn", "Sine", 3, true, nil ) end)
ERRORS:
Unable to cast string to token
Error happens on line 5
You'll need to get the EasingStyle and EasingDirection from Enum. Enum is just something that stores a bunch of stuff, not really sure. Here's an example:
local Inventory = script.Parent.Parent local CloseInventory = script.Parent CloseInventory.MouseButton1Click:Connect(function() Inventory:TweenPosition( UDim2.new(0.459, 0,1, 1), Enum.EasingDirection.InOut, -- InOut, not OutIn lol Enum.EasingStyle.Sine, 3, true, nil ) end)
Using a string for them will result in an error. Hope this helps!