How would I make the camera still follow the player while its being manipulated?

I was making a camera effect for a game I was making. I wanted to make the player screen flip upside down but I have a problem. Every time I try to flip the camera upside down It stops following the player, Ive tried making the camera subject a part of the player and it still didnt work. Any ideas on how to fix it? Heres my code so far.

wait(5)
print("camera flipped")
cam.CameraType = Enum.CameraType.Scriptable
cam.CFrame = cam.CFrame * CFrame.Angles(math.rad(180),0,0)

1 Like

Use RunService to continue to move the camera with the character. An example could be

cam.CameraType = Enum.CameraType.Scriptable
RunService.Heartbeat:Connect(function()
   cam.CFrame = character.Head.CFrame * CFrame.Angles(math.rad(180,0,0)
end)

This won’t be exactly what you want but it should point you in the right direction.

Flipping the camera is easy, there is a Camera:SetRoll(angle) method.
https://developer.roblox.com/en-us/api-reference/function/Camera/SetRoll

The reason why your camera stops moving is because the Scriptable CameraType means the default camera scripts should do nothing and let you move the camera.
You can still have both a camera manipulating script and the default camera scripts running if your camera script runs every frame right after the default scripts, there’s a way to do it with RunService:BindToRenderStep().

1 Like