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

Camera issues, can someone help?

I am a new scripter and I am in need of help. I have made a rotating camera script and that turned out fine, but I need help trying to go back to the player camera. I know I am missing something, but I don't know what. Here's the script:

local target = workspace.IntCam.CamBrick
local camera = workspace.CurrentCamera
camera.CameraSubject = target
local angle = 299

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,-10)       --Move the camera backwards 5 units
angle = angle + math.rad(.5)

wait(38.5)

target = game.Players.LocalPlayer.Character.Head


end


1 answer

✓ Accepted answer

Not sure if this was already solved since it was 5 hours ago but i'll still answer. Your while wait() do loop won't work like that, since it's waiting for 38 seconds after waiting for 1/30th of a second AKA wait() Also your camera's cameratype must be "Scriptable"

local player=Game.Players.LocalPlayer
local cam=Workspace.CurrentCamera
repeat wait() until player.Character
cam.CameraType="Custom"
cam.CameraSubject=player.Character:WaitForChild("Humanoid")
cam.CoordinateFrame=CFrame.new(0,0,0)

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