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

How do I make a player always move forward?

Asked by 1 year ago

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

Log in to vote
0
Answered by 1 year ago

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

0
Could you explain how to do that to a player. aydenwilson819 25 — 1y
0
use a custom player model with an attatchment in the waist Black_Magic2533 104 — 1y
0
I have found an answer but it was different to yours but since yours is the only answer I will accept it. aydenwilson819 25 — 1y
Ad
Log in to vote
0
Answered by 1 year ago

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.

Answer this question