Moving the character on the world axis regardless of camera rotation

im trying to move a player character along a platform that has a camera point down on them

however i dont know how to go about making it so that the character moves similar to the image below regardless of the camera.

i would really appreciate help in this

2 Likes

It depends on what exactly youre trying to do, can the player only move in 4 directions?
Generally to do this you can try editing the starter scripts although I’m not sure how much control over movement you can have. What you can try to do is keep checking that user’s input and then assigning Humanoid:Move or Humanoid:MoveTo. Or you can just assign the HumanoidRootPart a velocity or insert a linear velocity, however in this case the player will not be able to fall down while the linear velocity is active.

1 Like

Just move the character in it’s own object space using LookVector and RightVector, also the humanoid has a property called AutoRotate the could help you

1 Like

yeah at the moment i am trying to make the character move only in 4 directions, but i want the player to walk normally without manually changing the velocity

1 Like

im trying to make a tile based moving system thing but i need to figure out how to move the player in a way where it isnt affected by the camera rotation

If I gave you an exemple , the function moveA following the image you provided would be :

function moveA()
myPlayerCharacter.Humanoid:MoveTo(myPlayerCharacter.HumanoidRootPart.Position + Vector3.new(0,0,-10))
end

i typed this on my phone lol it’s not clean

Then detect input with input service and call moveA

how would i be able to overwrite this with the default movement controls

Try this :


local controls = require(game:GetService("Players").LocalPlayer.PlayerScripts.PlayerModule):GetControls()
controls:Disable()

thanks dude this really helped a lot

i do have to edit it a bit and change a few things but this really helps to put me in the right direction

No problem, I’m glad that I helped !

one thing, should i have all of the vectors to move the player into like a table? or should i just have it so theres different functions for every control

You could make a dictionary like this with the key for each vector :

local directions = {
 [Enum.KeyCode.W] = Vector3.new()
}

And then in your function move(key) you get the vector to add from the dictionary: … + direction[key]

alright thanks for the help again

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.