How would I get the CFrame of a specific player's camera?

Howdy. I’m attempting to create a part, that display’s another player’s camera, to all other clients using a viewport, in a surface GUI, however I don’t know where to start, with the player’s camera position. the only conclusion I could come too, is by getting the CFrame of the chosen player’s camera, though I don’t know how, since their camera is local. I haven’t been able to find anything similar to this, on the Dev forum, so far. If you’ve got any ideas, I would love to hear them.
P.S. This would be my first post, here on the Dev Forum! So please, let me know, if I’ve done anything wrong, related to this topic.

1 Like

you need to use a remote event and send the cframe from the client to the server

you can fire to the client to tell it to send the cframe over then fire it back to the server with the cframe

Okay, though how would I constantly update it so that it would match with the player’s camera, at all times? I attempted this earlier, though it gave an error, about exhausting the remote event.

could use something like propertychangedsignal

so like

Camera:GetPropertyChangedSignal('CFrame'):Connect(Function()
--update server here
end)

normally not the best practice to fire the server constantly if you are able to avoid it

Yeah, no so I attempted it again, and got the same error.
Remote event invocation queue exhausted for ReplicatedStorage.Updater; did you forget to implement OnServerEvent? I don’t understand what this means, since I’m sending the value’s from a local script, and already using OnServerEvent, on a Server Script.

show me the local and server script where the function is setup and fired

Here. So sorry for my sloppy coding, I’m relatively new.

local CamPart1 = game.Workspace.CamPart1
local Camera = game.Workspace.CurrentCamera
local var = false

local TweenInfo1 = TweenInfo.new(

	1.5,
	Enum.EasingStyle.Quad,
	Enum.EasingDirection.InOut,
	0,
	false,
	0
)

local TweenInfo2 = TweenInfo.new(

	.6,
	Enum.EasingStyle.Back,
	Enum.EasingDirection.In,
	0,
	false,
	0
)

local TweenInfo3 = TweenInfo.new(

	4,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.InOut,
	0,
	false,
	0
)

local CamPart0 = Instance.new("Part")
CamPart0.Name = "CamPart0"
CamPart0.Parent = game.Workspace
CamPart0.Anchored = true
CamPart0.Transparency = 1
CamPart0.CanCollide = false

_G.Cutscene = true

local TweenCamIn2 = TweenService:Create(CamPart0, TweenInfo2, {Position = Vector3.new(78.61, 5.308, 84.597)})
local TweenCamIn1 = TweenService:Create(CamPart0, TweenInfo1, {Position = Vector3.new(78.228, 5.313, 82.083)})

local RE = game.ReplicatedStorage:WaitForChild("VHSBind")

RE.Event:Connect(function(tween)
	game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 0
_G.Cutscene = true
	local TransitionGui = game.Players.LocalPlayer.PlayerGui.Transitions
	local TweenCamIn3 = TweenService:Create(TransitionGui.Frame, TweenInfo1, {Transparency = 1})
	print("got it")
	wait(1.5)
	print("tweening...")
	TweenCamIn1:Play()
	wait(2)
	TweenCamIn2:Play()
	wait(.6)
	TransitionGui.Enabled = true
	print("finished")
	wait(1)
	
	local Camera = game.Workspace.CurrentCamera
		
	local mouse = game.Players.LocalPlayer:GetMouse()
	mouse.Icon = "rbxassetid://5992580992"
	
	Camera.CameraType = Enum.CameraType.Custom
	game.ReplicatedStorage.TeleportPlayerVHS:FireServer(game.Players.LocalPlayer)
	local player = game.Players.LocalPlayer
	_G.Cutscene = false
	_G.player = player
	wait(1)
	TweenCamIn3:Play()
	local Updater = game.ReplicatedStorage:WaitForChild("Updater")
	local CFrameVal = game.Workspace.CurrentCamera.CFrame
		Camera:GetPropertyChangedSignal('CFrame'):Connect(function (update) --Here.
			Updater:FireServer(CFrameVal)
		wait()
	end)
end)

This is a local script, as well.
For whatever reason, it doesn’t seem to Fire, to the server in this state. I do believe, though it’s because there’s a function, inside a function. I don’t know if that’s possible.

RE.Event:Connect(function(tween)

Your error mentions ‘OnServerEvent’ (an event/signal of RemoteEvent objects) so it looks like you’ve gotten RemoteEvents and BindableEvents mixed up, you need to use the latter.