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

How do I make a player always move forward?

As the title says, I'm trying to make it so that you always move forward but can move left and right too. Here is what I have so far:

local RunService = game:GetService("RunService")
local Players = game:GetService("Players")

local player = Players.LocalPlayer

wait()
RunService:BindToRenderStep("move", Enum.RenderPriority.Character.Value + 1, function()
	if player.Character then
		local humanoid = player.Character:FindFirstChild("Humanoid")
		if humanoid then
			humanoid:Move(Vector3.new(0, 0, -1), true)
		end
	end
end)

That makes the player move forward forever but doesn't let the player move left or right. Which I want them to be able to move left and right while doing so.

2 answers

✓ Accepted answer

You could try using physics constraints in the character such as LinearVelocity, if that doesnt work then sorry, i can't help you

3 comments

0

Could you explain how to do that to a player.

0

use a custom player model with an attatchment in the waist

0

I have found an answer but it was different to yours but since yours is the only answer I will accept it.

I have found a solution, by using assembly linear velocity in a localscript in StarterCharacterScripts I have made it so the player automatically walks forward while being able to move left and right.

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