Setting Camera CFrame isnt working quite well

im tryna set the camera cframe to the part and its close but not exactly working like intended

image

Code:

ReplicatedStorage.Events.SetCamera.OnClientEvent:Connect(function(CameraPart)
	local Camera = workspace.CurrentCamera
	Camera.CFrame = CFrame.new(CameraPart.Position, CameraPart.Parent.Table.Top.Position)
	Camera.CameraType = Enum.CameraType.Fixed
end)

You probably want Scriptable, not Fixed for the camera type. What exactly is the problem though? Is it just not moving at all? Is it not moving to the correct place? Is it stuttering around? Can the player move it and you don’t want them to?

No, everything is working well its just that the camera is supposed to be in the position of the black cube

I think the previous reply was onto something, from what I understand you’re looking for the camera to act in position of the black cube from the black cube’s point of view? (Correct me if I am wrong.)

Here’s how I would go about doing this

ReplicatedStorage.Events.SetCamera.OnClientEvent:Connect(function(CameraPart)
local Camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable --Using scriptable instead of fixed because scriptable allows for custom camera positions
camera.CFrame = CameraPart.CFrame --I am not sure where your camera part is, but you would want to set it to the black cube itself 
end)

This code could be edited for your other purposes but i’m not entirely sure what this line below is supposed to happen with the table positioning and all of that, maybe you could clarify in a reply.

Camera.CFrame = CFrame.new(CameraPart.Position, CameraPart.Parent.Table.Top.Position)

The following documentation may help you:

Yeah thanks, the problem was I was using Fixed instead of Scriptable

the table part is the position where the camera is facing, btw