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

How do I prevent player from zooming out to see the whole playing field?

I like the default camera behavior for my game, with one exception. I don't want the player to be able to zoom out. Can I prevent this by simply limiting the height of the camera relative to the humanoid somehow? Thank you.

3 answers

✓ Accepted answer

I attempted doing this with the Camera in my game, and I could definitely tell you what not to do.

a) Programmatically zooming in the camera when it is above the limit doesn't work the way you might want it to because it is a very messy method of doing things and can often end up with the camera stuck zooming all the time.

b) The properties Player.CameraMaxZoomDistance and Player.CameraMinZoomDistance doesn't work, so that's out of the question.

c) Setting the zoom to a certain distance from the player when it goes past the Max turns out to be really choppy, and annoying when trying to play a game.

The best and probably easiest (maybe even laziest) method of accomplishing this that I have found out is to create a ZoomInScreen GUI when the player passes the Max limit. In other words, a GUI that pops up telling the player to zoom back in.

This is how many games probably do it (I can think of Apoc Rising off the top of my head) and probably the most efficient solution I have found yet.

3 comments

2

max zoom and min zoom definitely work.

0

the max zoom worked great. thank you.

0

Oh, the Camera Zoom Distance properties work now? They were deprecated when I tried them. Wow, go Roblox.

Ok these people are idiots. There is a service which I believe is called Starterplayer. Click on it while in studio. There should be options for maxCameraDistance etc. These control the camera.

1 comment

0

Thank you.

There is a camera zoom property in the workspace. Edit that to whichever radius you like.

This HAS to be edited via script.

1 comment

0

It isn't a property of workspace and you don't need a script to set it.

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