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

how do i encorporate lockfirstperson with camerasubject?

Asked by 9 years ago

Upon testing a Over-The-Shoulder camera script, I have noticed that if a camera has a camerasubject on something other than the player's character, I can't seem to lock the camera into first person.

How would I get it to lock in first person while also having the camerasubject be the part i attached to the player's torso?

Code:

local plr = game.Players.LocalPlayer
local cam = game.Workspace.CurrentCamera

local cp = Instance.new("Part", plr.Character)
cp.Name = "CameraPart"
cp.Transparency = 1
cp.Size = Vector3.new(1,1,1)

local w = Instance.new("Weld", plr.Character.Torso)
w.Part0 = plr.Character.Torso
w.Part1 = cp
w.C1 = CFrame.new(-3,-3,-2)

plr.CameraMode = "LockFirstPerson"
cam.CameraType = "Follow"
cam.CameraSubject = cp

Answer this question