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

GUI slightly moving in corner of screen?

Asked by 4 years ago
Edited 4 years ago

i am trying to make a GUI that is always slightly bobbing in the corner of the screen, but my script is not working

here is the script (i had a feeling it wouldn't work since i haven't played with tweening much)

GUI = script.Parent

while wait() do
    GUI:TweenPosition(UDim2.new(0.009, 0, 0.978, 0))
    GUI:TweenPosition(UDim2.new(0.009, 0, 0.013, 0))
end
0
post the code in a code block....the link is not working for me ForeverBrown 356 — 4y
0
my only question is how? DraconianSG 58 — 4y
0
done there you go DraconianSG 58 — 4y

1 answer

Log in to vote
0
Answered by
poke7667 142
4 years ago

The script isn't working because of a multitude of reasons. First, you have not fulfilled all the specified parameters for TweenPosition. You can find them here: https://developer.roblox.com/en-us/api-reference/function/GuiObject/TweenPosition You forgot to have: - easingDirection - easingStyle - time

Also, you shouldn't put a tween position in a loop that consistently repeats itself with almost no delay. You should add a small wait so players can actually see the movement like so:

GUI = script.Parent

while wait() do
    GUI:TweenPosition(UDim2.new(0.009, 0, 0.978, 0))
    wait(2) -- adding a wait will allow players to see the movement of the gui. 
    GUI:TweenPosition(UDim2.new(0.009, 0, 0.013, 0)) 
end
0
thx DraconianSG 58 — 4y
0
tho its not endlessly looping DraconianSG 58 — 4y
Ad

Answer this question