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 10 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:

ang = 0

while true do
    wait(0.1)
    local cam = game.Workspace.CurrentCamera
    cam.CameraSubject = game.Players.LocalPlayer.Character
    cam.CameraType = "Scriptable"
    --ang = ang + 0.01
    cam.CoordinateFrame = CFrame.new(0,10,10) * CFrame.Angles(1,ang,0)
end

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

EDIT: *** FIXED ***

ang = 0

while true do
    wait(0.01)
    local cam = game.Workspace.CurrentCamera
    cam.CameraType = "Scriptable"
    ang = ang + 0.01
    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)
end

1 answer

Log in to vote
0
Answered by 10 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:

local Character = game.Players.LocalPlayer.Character.Torso
local Cam = Workspace.CurrentCamera
Cam.CameraSubject = Character
local angle = 0

while wait(.1) do
    Cam.CoordinateFrame = CFrame.new(Character.Position) * CFrame.Angles(0, angle, 0) * CFrame.new(0, 10, -10)
    angle = angle + math.rad(1)
    Cam.Focus = Character.CFrame
end
0
Nope :/ YaYaBinks3 110 — 10y
0
Hmm.. what happens when you run it? When I tested it, it worked fine. infalliblelemon 145 — 10y
0
AROUND a character. Not on a character. YaYaBinks3 110 — 10y
Ad

Answer this question