Hi! I am currently trying to make a custom character controller so I can expand it more easily with custom movesets and the stuff. I’m currently trying to figure out how to get the player to look towards wherever they are walking to. I know there is a lot of bugs associated with this at the moment, which I will iron out, but it’s hard to deal with those problems when the player is shot down into the shadow realm for some reason, despite me never using the Y value ever.
do
local forceVector = Vector3.zero -- Vector that determines where the player should walk
for i, v in pairs(INPUT_TO_FORCE_VECTOR) do
if UserInputService:IsKeyDown(i) then
forceVector += v
end
end
if forceVector.Magnitude > 0 then
forceVector = forceVector.Unit
end
linearVelocity.VectorVelocity = forceVector * WALKSPEED
rootPart.CFrame = CFrame.lookAt(rootPart.Position, rootPart.Position + forceVector)
end