Collapse Sidebar




The CameraMinZoonDistance StarterPlayer property sets the minimum distance in studs the camera can be from the character with the default cameras.

This property sets the default value of Player/CameraMinZoomDistance for each player who joins the game. If this value is set to a higher value than StarterPlayer/CameraMaxZoomDistance it will be decreased to CameraMaxZoomDistance.

Code Samples

Setting Camera Zoom Distance

​The example demonstrates how to set a player’s camera minimum and maximum zoom distance.

In this example, we set the Player/CameraMinZoomDistance and Player/CameraMaxZoomDistance to set the min and max distance in studs a player’s camera can be from their character.

Note that since the example attempts to set the CameraMinZoomDistance to be greater than the CameraMaxZoomDistance, the CameraMinZoomDistance value will be decreased and set to the value of the max zoom distance.

To change the default min and max zoom distance values for a player when they first enter the game, you can change the StarterPlayer/CameraMinZoomDistance and StarterPlayer/CameraMaxZoomDistance properties.

local player = game.Players.LocalPlayer

player.CameraMaxZoomDistance = 50
player.CameraMinZoomDistance = 75