(I know, light theme, I wanted to shake things up today. Sue me.)
(also I know the Y value is 5, I was trying to see if it was working earlier. Spoiler alert: it didn’t.)
It’s not working, it’s supposed to make the first-person camera lower at all times, and it just does a buncha big fat nothing! Mind helping me out here?
You need to set the cameraType to “Scriptable” first and I’d recommend setting the cameraSubject to your “body camera” as seen in the following code:
local bodyCam = -- body cam
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = bodyCam
camera.CFrame = bodyCam.CFrame
If you would like to set it back, just change the “camera.CameraType” to Custom.
It is set only once. The camera needs to be updated every frame. As such, you’d need to place your code into a loop. (so it keeps running indefinitely, over and over again, every frame)
Make sure your variables, i.e bodyCam are properly defined. (so the game knows exactly which object to use)
local runservice = game:GetService('RunService')
runservice.RenderStepped:Connect(function(dt)
camera.CFrame = bodyCam.CFrame --* CFrame.new(0,0,0) incase you want to offset it.
end)
Thank you guys, I’m going to make another topic on this because Roblox decided to break and all of my scripts were screwed and they worked alright beforehand. Once again thanks for the help.