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

I cannot get my camera to spin around the part then my player?

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.4, angle, 0) --Rotate by the angle
                           * CFrame.new(1, 1, 10)       --Move the camera backwards 5 units
    angle = angle + math.rad(2)

wait (5)
game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
game.Workspace.CurrentCamera.CameraType = "Custom"
break
end

this script will not work, plz help

2 comments

0

What is the problem?

0

well its not focusing on the player

1 answer

✓ Accepted answer

You have a few problems with your script:

-You have a while loop that only runs once.

-You lack a loop that will rotate around the part

local target = workspace.Part
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = target
local angle = 0

while angle < math.pi*2 do --this will do one full rotation before returning the camera to normal
	camera.CoordinateFrame = CFrame.new(target.Position)  --Start at the position of the part
                           * CFrame.Angles(0.4, angle, 0) --Rotate by the angle
                           * CFrame.new(1, 1, 10)       --Move the camera backwards 5 units
	angle = angle + math.rad(2)
	wait()
end

game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
game.Workspace.CurrentCamera.CameraType = "Custom"

1 comment

0

:D Thanks For Helping

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