I have been trying to make a custom first person camera controller for a part of my game.
I’ve tried going with mouse.Move:Connect() and it does fire when moving the cursor, but the issue arises when trying to see in which direction the mouse is trying to move.
Here’s that part of the script:
local mouse = game:GetService("Players").LocalPlayer:GetMouse()
local prevMouse = {X = mouse.X, Y = mouse.Y}
local function MouseMove()
print(mouse.X - prevMouse.X)
print(mouse.Y - prevMouse.Y)
prevMouse.X, prevMouse.Y = mouse.X, mouse.Y
end
mouse.Move:Connect(MouseMove)
The problem is that because of the player being in first person the cursor is locked in the middle (which is preferable as it’s first person) and therefore the mouse doesn’t really move.
So the script just constantly prints out 0 of movement for both the X-axis and the Y-axis.
Some help would be greatly appreciated