Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Disable camera zoom while mouse is in gui?

I have made a custom scrolling frame, and it works, but there is only one problem: when I scroll in the frame, my camera zooms in and out. Before you say to set Max and Min Zoom distance, yes, I already did that. But, I don't want it to be like that. I just want to disable zoom while the mouse is inside of a Gui.

I could easily do this if I had a way of determining the character's current zoom distance.

1 comment

0

Or, you set a variable for whenever the gui is open and then disable scrolling

1 answer

Get the distance from the camera to the CameraSubject (in this case being the humanoid)

(Camera.CFrame.p-Camera.CameraSubject.RootPart.Position).magnitude

3 comments

0

Will try this right now.

0

It kind of works. It offsets the camera a little whenever setting the min and max zoom to that ^

0

Try seeingnthe offset value, like one too high for zoom or one too low

This discussion is preserved as it was. New answers, comments, and votes are closed.