How can you make a Movement System for a 2D game with guis, using TweenService?

Hi!

I have been trying to make a 2D game with guis, but i can’t get the movement right,
i have made a movement system my self, but it doesnt use TweenService there for
it doesnt have the animations.

here is the code :

local debounce4 = false
game:GetService("UserInputService").InputBegan:Connect(function(input, gameProcessedEvent)
	if input.KeyCode == Enum.KeyCode.A then
		if debounce4 == false then
			debounce4 = true
			script.Parent.Position = script.Parent.Position +  UDim2.new(-0.1,0,0)
		end
		wait(0.4)
		debounce4 = false
	end 
end)

Here the game if you want to see what i mean:
Gui Game Test

it does the job, but it just snaps in to the next position, witch i dont really want it to do that.
Thats why i want to use TweenService, witch has the animations.
But i dont know how to make it do the same thing as the plain “UDim2”

it would be nice that someone could help me with that
Thanks!
AlexFuzzy21

1 Like
yourFrame:TweenPosition(--[[Target position--]] UDim2.new(0.5,0,0.5,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, --[[Time--]] 0.5, --[[Override--]] true)