Accessing Client Camera not working on server even with RemoteEvent

  1. What do you want to achieve?
    Trying to fix this issue, I know you cant access the players camera in the server but you can if you use a RemoteEvent and that doesnt work for me at the moment…

  2. What is the issue?
    Can’t access Players camera in the server even with RemoteEvents

  3. What solutions have you tried so far?
    i have looked everywhere about this issue and i couldn’t find anybody talking about it, theres only demonstrations on how to get the camera in the server, i’ve tried it and it doesnt work, please tell me the issue if you can

Heres both the client script that fires the event, and the server that picks it up.

-- Server Script:
RS:WaitForChild("GetPlayerCam").OnServerEvent:Connect(function(Player, Camera)
	if Camera then
		print("Camera Found")
	else
		print("no cam")
	end
end)
-- Local Script:
local Camera = game.Workspace.CurrentCamera
wait(1)
game:GetService("ReplicatedStorage"):WaitForChild("GetPlayerCam"):FireServer(Camera)
1 Like

It depends on where the local script is. If it’s in the starter scripts, it will pass the camera very early. If it’s in the character, it will pass the camera from the character. That is my theory. You could try and pass the camera after the character loads.

The local script is in ReplicatedFirst

would this work?

local Camera = game.Workspace.CurrentCamera
game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function()
		game:GetService("ReplicatedStorage"):WaitForChild("GetPlayerCam"):FireServer(Camera)
	end)
end)

A client’s camera doesn’t exist on the server.

im sending the camera to the server with an event, that should work.

Why should it work? A client’s camera does not replicate to the server. Any camera manipulations should be performed by the client anyhow.

so theres no way at all i can access the camera in the server? even with events?

Correct, if you need to pass information about a client’s camera to the server (i.e; its CFrame) then you’d need to explicitly pass that instead, for example.

Remote:FireServer(Camera.CFrame)

1 Like

Oh! well thats actually quite useful, thanks for letting me know!