Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How can I make a camera spin around a Character 360°?

Asked by 11 years ago

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:

01ang = 0
02 
03while 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)
10end

However, it makes the camera spin. Not spin around the CHARACTER. So how can I go around doing this? thank you :)

EDIT: *** FIXED ***

1ang = 0
2 
3while 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)
9end

1 answer

Log in to vote
0
Answered by 11 years ago

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:

01local Character = game.Players.LocalPlayer.Character.Torso
02local Cam = Workspace.CurrentCamera
03Cam.CameraSubject = Character
04local angle = 0
05 
06while 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
10end
0
Nope :/ YaYaBinks3 110 — 11y
0
Hmm.. what happens when you run it? When I tested it, it worked fine. infalliblelemon 145 — 11y
0
AROUND a character. Not on a character. YaYaBinks3 110 — 11y
Ad

Answer this question