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

Rotating the camera around the focus?

Im trying to rotate the camera around the focus point. I have this for far,

		local cf = CFrame.new(cam.CoordinateFrame.lookVector*40)*CFrame.Angles(0,math.rad(rot),0)*CFrame.new(0,40,40)
		local fc = CFrame.new(cam.CoordinateFrame.lookVetcor*40)	
		cam.CoordinateFrame = CFrame.new(cf.p,fc.p)			
		rot = rot + 45		

but it doesn't work and I don't know why?

1 answer

You should look at the Wiki for Camera Manipulation! They teach and example of how to make your camera rotate around a part while teaching you about Camera Manipulation.

Here's the script they give anyway:

local target = workspace.Part
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = target
local angle = 0
 
while wait() do
    camera.CoordinateFrame = CFrame.new(target.Position)  --Start at the position of the part
                           * CFrame.Angles(0, angle, 0) --Rotate by the angle
                           * CFrame.new(0, 0, 5)       --Move the camera backwards 5 units
    angle = angle + math.rad(1)
end

You can learn even more with the link to Camera Manipulation Here!

  • Near the Bottom of the page is "Circling the part"

2 comments

0

I based the original script off that, but it still wont work

0

Go to the wiki link

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