I'm trying to make the menu in the corner of the screen (but that's not the problem) and in the meantime it is showing an image of a part of the map, however, it happens that the beginner shows and then errors start to occur, does anyone know what could it be? at first it looks the way I want it, but then it starts to turn the camera back to the player and try to go back to where the cameras are. Only, it is only to return to the player as soon as he presses the play button.

Script(in screenGUI):

wait()

local Tween = game:GetService("TweenService")

local Cam = workspace.CurrentCamera
local CamPoints = workspace:WaitForChild("CameraPoints")

local function TweenCameraPos(Point,Speed)
	Tween:Create(Cam,TweenInfo.new(Speed,Enum.EasingStyle.Linear),{CFrame = Point.CFrame}): Play()
end			

Cam.CameraType = Enum.CameraType.Scriptable
Cam.FieldOfView = 50

while true do
    Cam.CFrame = CamPoints:FindFirstChild("1").CFrame
    TweenCameraPos(CamPoints:FindFirstChild("2"),3)
    wait(3)
end

Gif: https://i.gyazo.com/149056ee7ed4002fe0d22c24bf5e5142.gif

5 comments

0

What are you trying to do? Can you connect the script to the play button?

0

well, I want to make the camera go through the map (with cam points, which are parts), while the player is in the menu

0

What are your errors?

0

Do you have other scripts interfering with the camera

0

the errors are that the camera is trying to return to the player, however I need it to be switching between the cameras that I decided, until the player clicks "play"