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

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

Asked by 9 years ago
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

0
What is the problem? EzraNehemiah_TF2 3552 — 9y
0
well its not focusing on the player zangdragonoid 0 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

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"
0
:D Thanks For Helping zangdragonoid 0 — 9y
Ad

Answer this question