Hello everyone, currently I'm trying to make a Camera spin around a Character 360°. However, I do not know how. I've currently had a try using this script:
01 | ang = 0 |
02 |
03 | while true do |
04 | wait( 0.1 ) |
05 | local cam = game.Workspace.CurrentCamera |
06 | cam.CameraSubject = game.Players.LocalPlayer.Character |
07 | cam.CameraType = "Scriptable" |
08 | --ang = ang + 0.01 |
09 | cam.CoordinateFrame = CFrame.new( 0 , 10 , 10 ) * CFrame.Angles( 1 ,ang, 0 ) |
10 | end |
However, it makes the camera spin. Not spin around the CHARACTER. So how can I go around doing this? thank you :)
EDIT: *** FIXED ***
1 | ang = 0 |
2 |
3 | while true do |
4 | wait( 0.01 ) |
5 | local cam = game.Workspace.CurrentCamera |
6 | cam.CameraType = "Scriptable" |
7 | ang = ang + 0.01 |
8 | cam:Interpolate(game.Players.LocalPlayer.Character.Head.CFrame * CFrame.Angles( 0 ,ang, 0 ) * CFrame.new( 10 , 5 , 0 ),game.Players.LocalPlayer.Character.Head.CFrame, 0.01 ) |
9 | end |
Make the cam's CFrame the character, zoom it out a few studs. Okay I don't think that was helpful xD I got the Wiki's example in Camera Manipulation, edited it slightly, it works, but sorry that I can't explain it D:
01 | local Character = game.Players.LocalPlayer.Character.Torso |
02 | local Cam = Workspace.CurrentCamera |
03 | Cam.CameraSubject = Character |
04 | local angle = 0 |
05 |
06 | while wait(. 1 ) do |
07 | Cam.CoordinateFrame = CFrame.new(Character.Position) * CFrame.Angles( 0 , angle, 0 ) * CFrame.new( 0 , 10 , - 10 ) |
08 | angle = angle + math.rad( 1 ) |
09 | Cam.Focus = Character.CFrame |
10 | end |