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

How do I change a character's FOV? [closed]

Asked by
hvnte_r 10
5 years ago

I can't script, but I'm trying to find a setting that allows me to change a character's FOV in my game. All of the sources I've found so far are outdated.

1
Then you should be chacking the wiki User#5423 17 — 5y

Closed as Not Constructive by EpicMetatableMoment, DeceptiveCaster, and evaera

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago
Please accept hit "accept answer" if this helped

Question

How do I change a character's FOV?

Answer

You can get the client's camera from a LocalScript. The CurrentCamera index in https://developer.roblox.com/api-reference/class/Workspace return's the client's camera.

Simply set the FieldOfView property on the camera to a desired FOV. (Note the FOV can only be set to range [1, 120] and it is default 70)

Example code

local players = game:GetService("Players")

local client = players.LocalPlayer
local camera = workspace.CurrentCamera --// get camera

camera.FieldOfView = 100 --// set FoV to 100
0
What do I put the script in? Workspace? hvnte_r 10 — 5y
0
Learn to read User#24403 69 — 5y
1
why so toxic? damn. hvnte_r 10 — 5y
0
You put the local script anywhere replicated to the client *(and where scripts run)* such as `ReplicatedFirst` `StarterPlayerScripts` `StarterCharacterScripts` and `Backpack` EpicMetatableMoment 1444 — 5y
View all comments (4 more)
0
Thanks. hvnte_r 10 — 5y
0
Also "StarterGui SerpentineKing 3885 — 5y
1
^^ @Sinister Also "StarterGui" is a valid choice SerpentineKing 3885 — 5y
0
I didn't mention everything but thanks for noting that! EpicMetatableMoment 1444 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

use the CurrentCamera property from workspace on the client, which is the player's camera. then change the FieldOfView property of it; article.

ex

--client

local camera = workspace.CurrentCamera

camera.FieldOfView = 50 -- default is 70 degrees