Hello. I am writing some scripts and while editing TweenPosition I had an error.
CODE:
01 | local Inventory = script.Parent.Parent |
02 | local CloseInventory = script.Parent |
03 |
04 | CloseInventory.MouseButton 1 Click:Connect( function () |
05 | Inventory:TweenPosition( |
06 | UDim 2. new( 0.459 , 0 , 1 , 1 ), |
07 | "OutIn" , |
08 | "Sine" , |
09 | 3 , |
10 | true , |
11 | nil |
12 | ) |
13 | 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:
01 | local Inventory = script.Parent.Parent |
02 | local CloseInventory = script.Parent |
03 |
04 | CloseInventory.MouseButton 1 Click:Connect( function () |
05 | Inventory:TweenPosition( |
06 | UDim 2. new( 0.459 , 0 , 1 , 1 ), |
07 | Enum.EasingDirection.InOut, -- InOut, not OutIn lol |
08 | Enum.EasingStyle.Sine, |
09 | 3 , |
10 | true , |
11 | nil |
12 | ) |
13 | end ) |
Using a string for them will result in an error. Hope this helps!