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

How Do I make the "CurrentCamera" UnZoomable?

Asked by 7 years ago

soo...I made this script.

local Position = game.Workspace.CameraLocation

game.Workspace.CurrentCamera.CameraSubject = Position
game.Workspace.CurrentCamera.CameraType = "Attach"

the only problem was , Player can Zoom In and Zoom out.

How Do I Make The Camera Can't Be Zoom In Or Zoom Out?

3 answers

Log in to vote
0
Answered by 7 years ago
local Position = game.Workspace.CameraLocation
local Datpart = -- Put how ever you are going to get the part the player is controlling
local Zoffset= -- how far camera is from part
local Yoffset= -- how high camera is from part

game.Workspace.CurrentCamera.CameraSubject = Datpart
game.Workspace.CurrentCamera.CameraType = "Scriptable"
game.Workspace.CurrentCamera.CoordinateFrame = Datpart.CFrame + CFrame.new(0,Yoffset,Zoffset)

So, I scripted a custom camera behavior, because default roblox ones allow zoom. This script takes the parts Cframe, then zooms out and up from variables you decide ( the variables are measured in studs)

0
OMG,Thank you so much! Danielkaya 58 — 7y
0
Your welcome User#17125 0 — 7y
Ad
Log in to vote
1
Answered by
luadotorg 194
7 years ago

For this, you should use the CameraMaxZoomDistance and CameraMinZoomDistance properties of Player.

It's easy, just set them to the value. It should be between 1 and 400.

You could use player.CameraMaxZoomDistance = player.CameraMinZoomDistance for the smallest zoom, or, 15, for the default zoom.

0
This Would Work If I Use My "Player" as a Subject.But Now, the Subject is a PART. This Won't Work. Danielkaya 58 — 7y
0
You should elaborate your questions more then, because I had no clue what you meant. Plus, this would work by using LocalPlayer either ways. luadotorg 194 — 7y
Log in to vote
0
Answered by
Viking359 161
7 years ago

In the game explorer there is a starter player tab or something like that. Two of its properties are max zoom and min zoom. Set those to 0. This is only if you want it like that permanently rather than changing it from something you already have.

Answer this question