Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Disable camera zoom while mouse is in gui?

Asked by
Arystov 45
6 years ago

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.

0
Or, you set a variable for whenever the gui is open and then disable scrolling damagex443 325 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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

(Camera.CFrame.p-Camera.CameraSubject.RootPart.Position).magnitude
0
Will try this right now. Arystov 45 — 6y
0
It kind of works. It offsets the camera a little whenever setting the min and max zoom to that ^ Arystov 45 — 6y
0
Try seeingnthe offset value, like one too high for zoom or one too low NexanianStudios 91 — 6y
Ad

Answer this question