Camera help probably NOW!

HI DEVS,

i am changing the players cameras CFrame but when i want to change back to the players normal camera it doesn’t change to the normal camera
heres a snippet on me trying to change the camera to be like before i changed it


camera.CameraType = Enum.CameraType.Custom	
camera.CameraSubject = player.Character.Humanoid

heres the whole script

local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local UIS = game:GetService("UserInputService")
local thing = true
UIS.InputBegan:connect(function(input)
	if Enum.KeyCode.Q == input.KeyCode then
		if thing == true then
			print(thing)
			camera.CameraType = Enum.CameraType.Fixed
			local pos = workspace.camera.CFrame.Position
			camera.CFrame = CFrame.new(pos,pos + workspace.camera.CFrame.lookVector)
			thing = false
		else
			print(thing)
			camera.CameraType = Enum.CameraType.Custom	 
			thing = true
		end
	end
end)
2 Likes

I don’t see it, you may have to reupload it.

1 Like

no, i just forgot but its fixed now

Have you changed the CameraSubject anywhere else? Also is this in a Local or Server script?

and no the local script is not named camera

i have one other script and it does nothing to the camera

Alright then, are they both LocalScripts? & are you getting the CurrentCamera instead of the actual Camera?

heres the whole script

local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local UIS = game:GetService("UserInputService")
local thing = true
UIS.InputBegan:connect(function(input)
	if Enum.KeyCode.Q == input.KeyCode and thing == true then
		print(thing)
		camera.CameraType = Enum.CameraType.Fixed
		camera.CFrame = CFrame.new(workspace.camera.CFrame.Position,workspace.camera.CFrame.lookVector)
		thing = false
	elseif thing == false then
		print(thing)
		thing = true
		camera.CameraType = Enum.CameraType.Custom	
	end
end)

yes i am getting the current camera

Don’t know why you’re setting the CameraSubject to the Humanoid if it’s already set by default

Only thing I see is that you could try setting the CameraType to Scriptable if that changes anything?

1 Like

on line 11 you need to do workspace.CurrentCamera.CFrame.Position instead of workspace.Camera.Position

Did you see post #8?

2 Likes

but this a local script and i only want to change the cam for only one player

it’s not possible to just do workspace.CurrentCamera.Position you need to get the position from the cframe

since when did i have to do this

i don’t get what you’re saying sorry but all i’m saying is if you want to get the vector3 position of the camera then you have to do workspace.CurrentCamera.CFrame.Position

why cant i just do

workspace.CurrentCamera.Position

it’s because position isn’t a property of the current camera

If you look at the wiki, you will see that Position is in fact not a property of camera.

my brain is more hot then my computer WHAT!? never knew changed it still not work