Infinite up and down tween

I’ve been developing and messing around in studio building and animated even messing around with particles! I’ve just recently started trying to understand scripts and guis but I’ve had a problem for the past few days:
I’ve wanted to make a gui title rotate and bob up and down ive gotten the rotate part down https://gyazo.com/edc1a8cefee00b8ddb58505f9d8ebdcb but i cant figure out the up and down

I couldn’t really display my problem as i got rid of the code i used so I’m looking for help to start from scratch sorry I couldn’t provide!

I’ve been using discord contacting friends i know who can script tutorials the dev tutorials even here on the forums but i cant seem to find a topic related to this specifically.

Anyways id like to thank you if you help me out and get my problem solved this helps me a lot!
.

2 Likes

The solution to your problem is easier than you think. I’d use TweenService and loop it constantly in order for the animation to remain the same forever.

local TweenService = game:GetService("TweenService")
local Text = "TEXT HERE"

while wait(3) do
	TweenService:Create(Text, TweenInfo.new(3, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {Rotation = -15}):Play()
	wait(3)
	TweenService:Create(Text, TweenInfo.new(3, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {Rotation = 15}):Play()
end

Of course there are plenty of ways to do this but I went for the simplest one.
Result:

2 Likes

I’m sorry if I come off as slightly rude, thank you for replying but I’ve got the rotation part down and I’m trying to figure out how to make it move slightly up and down in a sine infinitely. Thanks for responding and giving your time!

2 Likes

If you want the gui to move up and down slightly then adding a position property to the tween service should do the trick!

-- Goal for the item in question
{Rotation = 15, Position = "DESIRED POSITION"}

Here’s the final product.

local TweenService = game:GetService("TweenService")
local Text = script.Parent.TextLabel

while wait(3) do
	TweenService:Create(Text, TweenInfo.new(3, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {Rotation = -15, Position = Text.Position - UDim2.new(0, 0, 0, 75)}):Play()
	wait(3)
	TweenService:Create(Text, TweenInfo.new(3, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {Rotation = 15, Position = Text.Position + UDim2.new(0, 0, 0, 75)}):Play()
end

Edited: You can also change it’s moving style too!

2 Likes

Thank you so much for helping me find my solution I cant thank you enough!

1 Like

No problem. Glad I could help you.

1 Like