I believe you’re looking for this:
Is it a ghost ? it doesn’t look like one…
If the animation isn’t self-explanatory, it’s time to add extra cute details
In order to set multiple tweens, you need another instance to animate that must be a Parent or beyond, so that you can indirectly affect the child’s behavior
local Ghost = script.Parent.Ghost
local Speed = 0.9
local Side = false
while true do
Ghost.Below:TweenPosition(UDim2.fromScale(-0.73,0.7),"In","Linear",Speed,true)
if Side == true then
Ghost:TweenPosition(UDim2.fromScale(0.5,0.4),"In","Linear",Speed,true)
else
Ghost:TweenPosition(UDim2.fromScale(0.5,0.6),"In","Linear",Speed,true)
end
Side = not Side
wait(Speed)
Ghost.Below.Position = UDim2.fromScale(0,0.7)
end
Our first tween will never be disturbed… even if the Main Frame is also moving , the final position goals and duration remain the exact same.
The style Linear is a bit plain, so let’s try out something else : “InOut”,“Quad”
Here’s the link to the devforum post: [Advanced UI] Introduction to 2D Animations
Basically, “stack” the tweens. In your case, I’d imagine a structure like this:
FrameOuter (fully transparent)
FrameInner (contains your image/logo/whatever)
FrameInner is tweened to move infinitely left/right with Sine easing at 0.5s duration
FrameOuter is tweened to move infinitely up/down with Sine easing at 1s duration
1 Like