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

Starting Camera script grabs camera from player, but script is only sometimes working sometimes?

Asked by
acuaro 29
5 years ago
Edited 5 years ago

Hello there, in my game I have a Camera script at the beginning thats supposed to be the area where there is the "Load" ,"Updates" & "New " Buttons. What happens is sometimes the camera script works like it should. And other times it just dose not work and the camera goes to the player. The output is clear and the script seams fine. Heres the script (The script is local and is in a GUI)

------------VARS------------

local Camera = game.Workspace.CurrentCamera
local Player = game.Players.LocalPlayer

------------SCRIPT------------
repeat wait() until  Player.Character -- Waits till Player chracter is loaded

Camera.CameraType = "Scriptable" --- Makes Camera scriptable
Camera.CFrame = game.Workspace.campart.CFrame -- Cameras CFrame is = to the part in workspace (campart)
wait(5)
script.Parent.Enabled = true -- Enabling parent (which is GUI)

If you know why or could suggest and help me that would be wonderful!

--Acuaro

Answer this question