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

how do I edit how zoomed in a camera is?

Asked by
Prioxis 673 Moderation Voter
9 years ago

so I'm making a main menu which is going to manipulate the camera to follow a target already got this part down my only problem is is that its too close to the part I want it to zoom out more to see the actual map how can I achieve this? I've tried resizing it but that kind of screws up the camera

1 answer

Log in to vote
0
Answered by
Bman8765 270 Moderation Voter
9 years ago

I'm not for sure if what you use but I'll give a simple example. (next time including your code would be very useful)

local target = --Insert your target here that you want the camera to follow
local camera = workspace.CurrentCamera -- Your camera
camera.CameraType = Enum.CameraType.Scriptable -- Sets camera type to scriptable (don't have to do this)
camera.CameraSubject = target 
local angle = 0
local go = 0

game:GetService("RunService").RenderStepped:connect(function()
    camera.CoordinateFrame = CFrame.new(target.Position)
                           * CFrame.new(0, 0, 25) -- This changes the position of the camera, probably what you're looking for so payattention to this part. The last number changes the length away from the character
    go = 1
end)

In that script above it is basically finding the character, centering the camera on it's head and then moving it away around 25.

Here is the wiki for more info on Camera manipulation http://wiki.roblox.com/index.php/Camera_manipulation

Ad

Answer this question