I am a new scripter and I am in need of help. I have made a rotating camera script and that turned out fine, but I need help trying to go back to the player camera. I know I am missing something, but I don't know what. Here's the script:
01 | local target = workspace.IntCam.CamBrick |
02 | local camera = workspace.CurrentCamera |
03 | camera.CameraSubject = target |
04 | local angle = 299 |
05 |
06 | while wait() do |
07 | camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part |
08 | * CFrame.Angles( 0 ,angle, 0 ) --Rotate by the angle |
09 | * CFrame.new( 0 , 0 ,- 10 ) --Move the camera backwards 5 units |
10 | angle = angle + math.rad(. 5 ) |
11 |
12 | wait( 38.5 ) |
13 |
14 | target = game.Players.LocalPlayer.Character.Head |
15 |
16 |
17 | end |
Not sure if this was already solved since it was 5 hours ago but i'll still answer. Your while wait() do loop won't work like that, since it's waiting for 38 seconds after waiting for 1/30th of a second AKA wait() Also your camera's cameratype must be "Scriptable"
1 | local player = Game.Players.LocalPlayer |
2 | local cam = Workspace.CurrentCamera |
3 | repeat wait() until player.Character |
4 | cam.CameraType = "Custom" |
5 | cam.CameraSubject = player.Character:WaitForChild( "Humanoid" ) |
6 | cam.CoordinateFrame = CFrame.new( 0 , 0 , 0 ) |