Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Problem with making a player move forward using tween service?

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()

1 answer

✓ Accepted answer

You'll need to do:

Position = root.Position + (root.CFrame.lookVector * stud_distance)

1 comment

0

O thanks. I'm still not so good at CFrame so i'll do some more research.

This discussion is preserved as it was. New answers, comments, and votes are closed.