Hey, So I have tried making a simple intro where the players camera is taken to look at a small piece of land that I’ve made, Everything works perfectly fine in studio which i was alright with but upon loading into Roblox to see how everything runs there. That’s where my complications start.
Note;
If anyone is willing to help, All I’m looking for is the camera to stay at a fixed position until the user presses play and then continue with gameplay. And the issue im facing is the users camera isnt showing at the place id like it to. Anyways, Thanks
Current code im using for the camera
local PB = script.Parent.Frame.Play
local QB = script.Parent.Frame.Leave
local Camera = workspace.CurrentCamera
local Player = game.Players.LocalPlayer
repeat wait() until Player.Character
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = game.Workspace.StartMenuCamera.CFrame
script.Parent.Enabled = true
local function Play()
script.Parent:Destroy()
Camera.CameraType = Enum.CameraType.Custom
end
local function Leave()
game.Players.LocalPlayer:Kick("You chose the easy way. You can rejoin though,")
end
PB.MouseButton1Down:Connect(Play)
QB.MouseButton1Down:Connect(Leave)
Most always when something works in studio but not in an actual game, its an issue with timing. Studio has no lag.
Realizing I have not looked over your script, so this might not pertain to you, but maybe see if you need to wait a little bit before setting the camera to look at the intro land.
local PB = script.Parent.Frame.Play
local QB = script.Parent.Frame.Leave
local Camera = workspace.CurrentCamera
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CameraSubject = game.Workspace.StartMenuCamera
Camera.CFrame = game.Workspace.StartMenuCamera.CFrame
PB.MouseButton1Down:Connect(function(Play)
script.Parent:Destroy()
Camera.CameraType = Enum.CameraType.Custom
end)
QB.MousButton1Down:Connect(function(Leave)
Player:Kick("You chose the easy way. You can rejoin though,")
end)
I really just cleaned up your code a bit, like you said, line 12 was not really necessary.