How to set the camera for the player the same as it was?
So at the beginning of the game I make the camera rotate around a part. I change the camera a few times while you're creating your character. After that I need to set the camera back to the way it was. Here is the camera script that makes the camera rotate around a part,
01 | camera = game.Workspace.CurrentCamera |
02 | camera.CameraSubject = game.Workspace:WaitForChild( "FocusHere" ) |
03 | camera.CameraType = "Scriptable" |
04 | camera.FieldOfView = 60 |
08 | camera.CoordinateFrame = game.Workspace:WaitForChild( "FocusHere" ).CFrame * CFrame.Angles(math.rad( 0 ),math.rad(num 1 ),math.rad( 0 )) * CFrame.new( 0 , 5 , 7 ) |
Now I need to make the camera follow the player the way it was before rotating around the part. How would I do this? This is what I tried,
1 | local plr = game.Players.LocalPlayer |
2 | local camera = game.Workspace.CurrentCamera |
3 | camera.CameraSubject = plr.Character:WaitForChild( "Head" ) |
4 | camera.CameraType = "Follow" |
7 | camera.CoordinateFrame = plr.Character:WaitForChild( "Head" ).CFrame |
Making the cameraType "Follow" doesn't work the way it normally does. It makes it so the player can look through solid parts and I DO NOT want that. I've also set the cameraType to "Custom" but that didn't work. It works better but the player can still see through parts.
Any help is appreciated.