Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Everytime I use tween on a GUI, it says Unable to Cast to Dictionary?

Asked by 3 years ago

Full Script:

local tweenservice = game:GetService("TweenService")
local slider = script.Parent.Parent.Slider
local endpoint = {
    UDim2.new(0.538, 0, 0, 0);
} 

local info = TweenInfo.new(
    1,
    Enum.EasingStyle.Circular,
    Enum.EasingDirection.Out,
    0,
    false,
    0
)

 -- Error
local slideanim = tweenservice:Create(slider, info, endpoint)

script.Parent.MouseButton1Click:Connect(function()
    slideanim:Play()
end)

Picture in explorer:

!image

0
Try assigning what property to animate for your slider in endpoint. Try Position = UDim2.new(0.538, 0, 0, 0) veeplerthekrim -5 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

You need to specify the property you want to change.

If you want to change the position then do:

local endpoint = {
    Position = UDim2.new(0.538, 0, 0, 0);
} 

Hope I helped!

Ad

Answer this question