-
What do you want to achieve?
I manually set the camera’s CameraType and CFrame when the player joins the game. The camera on it’s own moves down some. I have a suspicion that it is the built-in camera scripts, but I’m not sure. -
What is the issue? Include screenshots / videos if possible!
Here is my camera script:
local camera = workspace.CurrentCamera
local cameraHeight = 90
local cameraCFrame = CFrame.new(Vector3.new(0, cameraHeight, 0), Vector3.new(0, 0, 0))
local fov = 60
local function setCameraType()
print("Setting camera type")
if camera.CameraType ~= Enum.CameraType.Scriptable then
camera.CameraType = Enum.CameraType.Scriptable
camera.FieldOfView = fov
camera.CFrame = cameraCFrame
end
end
-- Camera somehow gets set to Custom on its own, so I set it to Scriptable when it gets changed
camera:GetPropertyChangedSignal("CameraType"):Connect(setCameraType)
setCameraType()
while wait(1) do
print(camera.CFrame)
end
Output:
As you can see, I set the camera to Scriptable every time it tries to set itself, and I also set it’s CFrame. It still manages to change it’s CFrame. When in an actual game (played on the website, not in Studio), the position gets changed to 0, 16.25, 0
. I have no idea why this occurs, as this script is the only place I do anything with the camera.
EDIT:
I know I don’t have some kind of malicious script in my game, because I did Ctrl + Shift + F and searched “Camera”, and the only lines that came up are from the script I just showed.
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have looked on the DevForum and Google, and can’t find anything about it there.