I'm trying to use the tween service to smoothly move a player forward a certain amount of studs. I tried using lookVector because the player has to always be moving forward despite whichever direction they're facing.
local tweenInfo = TweenInfo.new( 0.45, -- TweenLength Enum.EasingStyle.Quint, -- EasingStyle Enum.EasingDirection.Out, -- EasingDirection 0, -- Repeat false, -- Revert 0 -- Delay ) local properties = { Position = root.CFrame.lookVector + Vector3.new(5,0,0) } local tween = tweenService:Create(root,tweenInfo,properties) tween:Play()
You'll need to do:
lua
Position = root.Position + (root.CFrame.lookVector * stud_distance)