Good Day
Here is my issue:
I’m trying to get the Player’s camera to change position from one part to another.
The first part is the part used for the game’s starting menu. The second is where I want to carry the camera to look at a specific area. I have a script that is located within Starter player scripts in a local script, which contains:
game:GetService("Players").PlayerAdded:Connect()
local MenuCam = workspace.CurrentCamera
local player = game.Players.LocalPlayer
local FocusPart = game.Workspace.GameSetCameraPositions.Menu.MenuFocusPart
MenuCam.CameraType = "Watch"
MenuCam.CameraSubject = FocusPart
while wait() do
local Camera6 = game.Workspace.GameSetCameraPositions.SecurityCameras.Cam6
local PlayButton = game.StarterGui.ScreenGui.PlayButton
if
PlayButton.Active ~= true
then
MenuCam.CameraType = "Watch"
MenuCam.CameraSubject = Camera6
end
end
The first part of the code works perfectly. However, up until “while wait() do” is giving issues. I want to detect when the play button is hidden, to move it to the position of “Camera6”.
I know that I am probably supposed to use “Scriptable” as the camera type, however, when I do, the entire screen turns the colour of the menu frame. When the play button is clicked and the frame dissappears, the camera only shows grey.
Can someone help?
Also, if this is in the wrong channel or catergory, please let me know so that I may change that.
Thank you!