I've been having an issue with this script where I'm unable to detect exactly when the player moves to the right, is it not possible or am I just dumb?
local movementDirection = camera.CFrame:vectorToObjectSpace(humanoid.MoveDirection).Unit
if math.abs(movementDirection.X) > math.abs(movementDirection.Z) then
camera.CFrame *= CFrame.Angles(0,0,0.1) -- This makes the camera tilt slightly to the left, but since i have no idea how to detect if the player is moving RIGHT, I can't re-use this line and subtract the value so that it veers into the opposite direction.
elseif math.abs(movementDirection.X) < math.abs(movementDirection.Z) then
print("forward or backward")
end
I'm also stuck on how to lerp/tween the camera.CFrame manipulation part, since i want it to be smooth instead of instantaneous.
Keep in mind this script is inside a RenderStepped function!

2 comments
Idk how exactley u want it but i suggest you should compare only if a key is pressed. So like if D is pressed/held then function
@CRAZYQUACKY84 That wouldn't be the smartest option.