✓ Accepted answer
You could make a script that detects when the player's mouse is hovering over the frame, and then set the player's camera min and max zoom distance properties to whatever distance the camera is away from the head. That way the camera gets locked in place no matter what zoom level the player is at. Then when the player moves the mouse off the frame, the min and max zoom distance properties get reverted to whatever they were before. Something like this:
local prevMin = 0.5
local prevMax = 400
Frame.MouseEnter:connect(function()
local camDist = (Cam.CoordinateFrame.p - Head.Position).magnitude
prevMin = Player.CameraMinZoomDistance
prevMax = Player.CameraMaxZoomDistance
Player.CameraMinZoomDistance = camDist
Player.CameraMaxZoomDistance = camDist
end)
Frame.MouseLeave:connect(function()
Player.CameraMinZoomDistance = prevMin
Player.CameraMaxZoomDistance = prevMax
end)
Hope this helped!
2 comments
I'm not requesting a script, just asking how I could do this.
you could try locking the camera when the gui has focus, but this may become problematic.