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

How can I lock a Camera in first-person or third-person?

Asked by
Zerio920 285 Moderation Voter
10 years ago

I'm wondering what script would allow me to lock a player's camera into third or first-person mode. I heard that minzoom and maxzoom weren't working, and I haven't had much luck with it either. It would be helpful to have the camera locked a set distance away from the player though. Any ideas?

3 answers

Log in to vote
1
Answered by 10 years ago
1game.Players.PlayerAdded:connect(function(plr)
2    plr.CharacterAdded:connect(function(char)
3        if plr and char then
4            plr.CameraMaxZoomDistance = 0.5
5            plr.CameraMinZoomDistance = 0.5
6        end
7    end)
8end)
1
Next time, don't just post code. Others may not be able to understand your code and will not learn from it. Spongocardo 1991 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

game.Players.LocalPlayer.CameraMode = "2"

Log in to vote
0
Answered by 10 years ago
01self = script.Parent
02c = workspace.CurrentCamera
03 
04player = game.Players.LocalPlayer
05char = player.Character or player.CharacterAdded:wait()
06humanoid = char:WaitForChild("Humanoid")
07 
08-- Apply some properties
09 
10player.CameraMaxZoomDistance = 0.5
11c.FieldOfView = 100 -- Things get trippy if we don't do this.
12humanoid.CameraOffset = Vector3.new(0,0,-0.5)
13 
14function lock(part)
15    if part and part:IsA("BasePart") then
View all 36 lines...
0
What's this? Muoshuu 580 — 10y

Answer this question