#How to move the Player in Its facing direction?
1 messages · Page 1 of 1 (latest)
like teleport?
prob changing HumanoidRootPart's cframe
with lookvector
no
like when you move
it moves in the directon of the camera
how do i make it move in the direction the player's facing
uh
no idea unless u just use runservice and camera type scriptable
to just keep updating it
I have this script but the controls are inversed
RunService:BindToRenderStep("TankMovement", Enum.RenderPriority.Character.Value + 1, function()
local character = player.Character
if character then
local humanoid = character:FindFirstChild("Humanoid")
local hrp = character:FindFirstChild("HumanoidRootPart")
if humanoid and hrp then
local input = Controls:GetMoveVector()
if input.Magnitude > 0 then
-- Just pass the local vector, and useCameraRelative = true means HRP-relative
humanoid:Move(input, false)
else
humanoid:Move(Vector3.zero, false)
end
end
end
end)
so wait am bit lost what u wanna do
when i press W instead of moving the player in the camera's direction, move it in the direction the character is facing
like this kinda
so basically like stuck in shiftlock?
is that what u want
i cant explain well
but uh
u could try smth with .LookAt
of Cframe
kinda but you can still move the camera with shiftLock
to get where its looking
couldnt u like, take control over WASD
and
in the vid it works its just inversed
it uses runservice and Humanoid:Move
RunService:BindToRenderStep("TankMovement", Enum.RenderPriority.Character.Value + 1, function()
local character = player.Character
if character then
local humanoid = character:FindFirstChild("Humanoid")
local hrp = character:FindFirstChild("HumanoidRootPart")
if humanoid and hrp then
local input = Controls:GetMoveVector()
if input.Magnitude > 0 then
-- Just pass the local vector, and useCameraRelative = true means HRP-relative
humanoid:Move(input, false)
else
humanoid:Move(Vector3.zero, false)
end
end
end
end)
all
tbf if i was in this situation id just change input.X to -input.X
same with others
that should workkkk rightt
or am slow
hol up
what i did was change :Move(input) and put a - before input, but its going in the worlds direction
But
i dont think it would work otherwise
no idea then sorry
i think your shift lock idea would be best ntit
since it doesnt change the player's rotation
dont think it would work in your case tho
yea but in my actual game it changes this players camera to a part
so camera is stuck?
a diff player moves it
i see
kinda complicated
maybe my first idea wouldnt be that bad
to
disable WASD functionality
and
if pressed W
then move in humanoidrootpart.CFrame.LookAt
i kinda tried this but once you try to go right it changes rotation
so it just spins the player
huhh
since when you press D or A it changes orientation, it will change the humanoidRPart's rightvector and cause it to spin
one way i can think of is set the rightVector/Lookvector before the moving
idk what u making but do u rly need it to turn when A/D?
cant u just make it look forward and just move in correct direction
so always looks one direction
no like
make it always look in specific direction
And W moves forward (based on lookvector)
S backwards again with lookvector
and A/D dont turn it, but make him move left/right
if u get what i mean
so like shiftLock?
Your can stop shiftlock by working by disabling autorotate property in the humanoid
probably will also fix the problem with rotating when your press w