How to flip the in-studio camera with CFrame in studio? (SOLVED BY ME)
Asked by
4 years ago Edited 4 years ago
So, I'm currently working on a plugin that makes it easier to make cutscenes. But, I ran into a problem. For this to work I need to be able to rotate the in-studio camera. I have this code:
2 | game.Workspace.Camera.CoordinateFrame = |
3 | game.Workspace.Camera.CoordinateFrame* CFrame.Angles( 0 , 0 , math.rad( 180 )) |
4 | RunService.RenderStepped:wait() |
But all it does is make an endless loop of it going upside down and up again. Is there another script preventing this from happening. idk plz help!
ANSWER:
The problem was the Camera type had to be set to fixed!
WORKING CODE:
1 | local RunService = game:GetService( "RunService" ) |
3 | game.Workspace.Camera.CameraType = Enum.CameraType.Fixed |
5 | game.Workspace.Camera.CoordinateFrame = |
6 | game.Workspace.Camera.CoordinateFrame* CFrame.Angles( 0 , 0 , math.rad( 180 )) |
7 | RunService.RenderStepped:wait() |
9 | game.Workspace.Camera.CameraType = Enum.CameraType.Custom |
SIMPLIFIED CODE:
1 | game.Workspace.Camera.CameraType = Enum.CameraType.Custom |
2 | game.Workspace.Camera.CoordinateFrame = game.Workspace.Camera.CoordinateFrame* CFrame.Angles( 0 , 0 , math.rad(num)) |
by: @BongoCatJoosan