Hello devs! I’m working on a movement system that replicates the feel of Source Engine’s movement, I’m using humanoid:Move to move the player in a direction, but here’s the problem, when I try to use it, it just causes the body parts to get destroyed and I don’t know why, here’s my code (it’s still WIP):
local function getMovementDirection()
local direction = Vector3.new()
if movementInputs.forward == true then
direction -= Vector3.new(0,0,1)
end
if movementInputs.backward == true then
direction += Vector3.new(0,0,1)
end
if movementInputs.left == true then
direction -= Vector3.new(1,0,0)
end
if movementInputs.right == true then
direction += Vector3.new(1,0,0)
end
return direction.Unit
end
Nevermind, fixed it by having a variable called movementDirection which is an empty Vector3 and changed the previous variable to movementVelocity, then checked if magnitude of movementVelocity was above 0 and then set movementDirection to movementVelocity and applied the camera rotation stuff, now it works.