Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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

3 comments

0

Nope :/

0

Hmm.. what happens when you run it? When I tested it, it worked fine.

0

AROUND a character. Not on a character.

This discussion is preserved as it was. New answers, comments, and votes are closed.