So I want to create a script that moves the player foward based on the direction they are looking, so no matter which way they are facing they will always move - on the Z axis.
I have severall attempts at this, all of which have failed, so I am here.
Here is my code:
local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local h = char:WaitForChild("Humanoid")
wait(6)
print("Moving")
--h:MoveTo(char:WaitForChild("HumanoidRootPart").CFrame.LookVector * CFrame.new(0,0,5).Position)
--game.Players.LocalPlayer:Move(Vector3.new(0, 0, -5000), false)
--h.WalkToPoint = char.HumanoidRootPart.CFrame.Position + (char.HumanoidRootPart.CFrame.LookVector * Vector3.new(0, 0, 20))
h:MoveTo(char.HumanoidRootPart.CFrame:ToObjectSpace(CFrame.new(0,0,20)))
The comments are my other failed attempts
All help appreciated!