You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
i want to tween a gui to move up and down when the player walks - What is the issue? Include screenshots / videos if possible!
the gui always goes to the top left corner no matter what positition i tween it to - What solutions have you tried so far? Did you look for solutions on the Creator Hub?
i have tried changing the anchor point
local player = game.Players.LocalPlayer
local parent = script.Parent
local tweenservice = game:GetService("TweenService")
local tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,true)
local runservice = game:GetService("RunService")
local humanoid = player.Character:FindFirstChild("Humanoid")
local isplaying = false
local function move()
local position1 = UDim2.new({0.5, 0},{0.75, 0})
local tween = tweenservice:Create(parent,tweeninfo,{Position = UDim2.new(position1)})
tween:Play()
end
local function walking()
if humanoid then
if humanoid.MoveDirection.Magnitude > 0 then
if isplaying == false then
isplaying = true
move()
task.wait(2)
isplaying = false
end
return
end
end
end
runservice.RenderStepped:Connect(walking)