How do i make my CurrentCamera follow my Mouse?

Eh-Oh!

[ Information ]

Im TinkyWinkyDev, a Indie Developer. Im current making a almost-fully interactible menu. But i need to my CurrentCamera follow my mouse… But i dont know how do i do this, i tried searching tutorials but i dindt finded any.

[ Images of the Menu ]

[ Video of the Menu ]

[ More Information ]

Has you can see, some objects i cant interact, because my camera is fixed.

Thanks for Reading and Helping, TinkyWinkyDev.

1 Like

Thats really cool!

Regarding your question, You can make your Camera face your mouse using CFrames.
Heres what I mean.

local RunService = game:GetService("RunService");
local Mouse = game.Players.LocalPlayer:GetMouse();
local Camera = workspace.CurrentCamera;

RunService.Heartbeat:Connect(function()
    Camera.CFrame = CFrame.new(Camera.CFrame.Position, Mouse.Hit.p);
end)

Hope this helps!

1 Like

Thanks! You’re the only that answered my doubt.

Thats really cool!

Thanks x2.

1 Like

Its kinda glitchy, but you dont need to worry. I will search more about Mouse.Hit.Position, anyways, thanks.