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

LOCKING PLAYER FOV, can someone help me?

Asked by 8 years ago

im trying to lock the players FOV but it wont work D: help this script is a local script inside of a tool inside of starter pack

local cam = workspace.CurrentCamera
local playr = game.Players.LocalPlayer
cam.CameraSubject=playr.head
cam.CameraType = "Attach"

script.Parent.Parent.Parent.CameraMinZoomDistance = CameraMinZoomDistance.300
script.Parent.Parent.Parent.CameraMinZoomDistance = CameraMaxZoomDistance.300

why isnt it working?

1 answer

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

If you're just trying to change the FieldOfView, use this:

script.Parent.Equipped:connect(function()
    workspace.CurrentCamera.FieldOfView = Put what FOV you want here
end)

Change script.Parent to script.Parent.Parent if you put the script in the tool's handle.

If you're not familiar with the Equipped event, you can find it here: http://wiki.roblox.com/index.php?title=API:Class/Tool/Equipped

If you want to change the FOV when they unequip the tool, just take the function and change Equipped to Unequipped and set the FOV to whatever you want it to be when the tool is unequipped.

Also in line 3, you can't use playr.head because you're inside of the player not the player's character. To get the character, all you have to do is use playr.Character. In lines 6 and 7, if you want to change the game's default min and max zoom distance, you can change them in StarterPlayer. There's a section named Camera.

0
thanks tommytherox 5 — 8y
Ad

Answer this question