Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is the character not moving 15 studs in the looking direction?

Asked by
MAKKU 37
5 years ago

So I'm trying to make the character move 15 studs in the direction the head is looking at. Instead it just moves one certain direction.

plr.Character.HumanoidRootPart.CFrame = plr.Character.HumanoidRootPart.CFrame *     CFrame.new(plr.Character.Head.CFrame.lookVector * 15)

1 answer

Log in to vote
1
Answered by 5 years ago

try this:

plr.Character.HumanoidRootPart.CFrame = CFrame.new(plr.Character.HumanoidRootPart.Position + plr.Character.HumanoidRootPart.CFrame.LookVector * 15)
Ad

Answer this question