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

Why won't my frame update when I press the button even though it works??

Asked by 3 years ago

So I'm making a game right and I have a menu where the player can pick their classes you know the typical RPG game but the problem is the script works right but the frame that I want to animate doesn't work but there are no errors at all. Here is the script. I was going to share a pic of Roblox studio but I don't know how to upload photos to this website. I thank anyone who is willing to help me. So I checked the frame and the script works the frame moves when I press the button but it doesn't update the original frame just stays there.

local textButton = script.Parent

textButton.MouseButton1Click:Connect(function()
        local frame = script.Parent.Parent.Parent.Parent.ClassPickerGui.ClassPick
        frame:TweenPosition(UDim2.new(0.879,0,0,0))
        frame.Visible = true
end)


0
Please explain what are you trying to do, I didn't understand. Hamoodiyt 26 — 3y
0
sorry the code i inputted is a little buggy in this website, it doesn't get all inside the form lolmarios2647 46 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

local TextButton = script.Parent

local frame = script.Parent.Parent.Parent.Parent.ClassPickerGui.ClassPick

TextButton.MouseButton1Click:Connect(function()

frame:TweenPosition(
    UDim2.new(0.879,0,0,0),
    "Out",
    "Quad",
    0.5,
    true,
    nil
)

end)

-- What you missed is basically some other paremeters that you need to tween the UI --Apart from the end position, you need the EasingStyle, EasingDirection, Time in seconds, Tween overlap and a nil value for some reason (input nil only if you input UI Overlap to true)

0
If this doesn't really work, show me all of your UI workspace so i can see how i can help lolmarios2647 46 — 3y
0
Sorry for not replying early but scripting helped wasn't really working ketp giving the error 504. I'll try it out tmr rn I don't have time. Thank you. II_Goodlu 8 — 3y
0
It worked thx but how do i decrease it's speed. It's so fast. II_Goodlu 8 — 3y
0
just get the time in seconds from 0.5 to 1 if you want lolmarios2647 46 — 3y
Ad

Answer this question