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

How to make a camera change when i press a button (as an intro)?

Asked by 4 years ago
Edited 4 years ago

So I was trying to make a title screen where the camera is at a custom point. I don't have a very good understanding of CFrame or camera control period. Here is my script:

local camera = game.Workspace.CurrentCamera

local player = script.Parent.Parent.Parent

local button = player.PlayerGui.ScreenGui.TextButton

repeat
    camera.CameraType = Enum.CameraType.Scriptable
until
    camera.CameraType == Enum.CameraType.Scriptable

camera.CFrame = game.Workspace.Camera1.CFrame

button.MouseButton1Click:Connect(function()
    camera.CameraType = Enum.CameraType.Custom
    button:Destroy()
end)
0
When a player character loads, things in StarterGui are cloned into that player PlayerGui, so you should be using PlayerGui instead. NotedAPI 810 — 4y

Answer this question