Using camera on a title screen

Hey guys this is a pretty straightforward issue im having due to inexperience. In my games I keep trying to do a menu that uses a camera to show scenery and whatnot like prison life where it shows the outside of the building from in the air. But everytime I try scripts I feel like should work. It does nothing.

I usually try to do a local script inside of startergui and use this script

local CamPart = Workspace.CamPart (Block used as a camera)
local Camera = Workspace.CurrentCamera
Game.Players.PlayersAdded:Connect(Function()

Camera.CameraType = “Scriptable”
Camera.CFrame = CamPart.CFrame

end

I’ve also tried switching the camera type to fixed with a parts cframe but nothing does anything. The only time I’ve gotten a cam to work is with a click detector where it switches to a fixed camera for a second but nothing useful for a title screen. Any help is appreciated and I know someones probably asked this question before but I couldn’t find anything and just want help with it now.

1 Like

Is this local? If it isn’t, CurrentCamera doesn’t exist

2 Likes

yeah it is local. Can a main menu camera not be local? (Seriously wondering)

You don’t need to use PlayerAdded.

You can basically do this:

local CamPart = Workspace.CamPart (Block used as a camera)
local Camera = Workspace.CurrentCamera

Camera.CameraType = “Scriptable”
Camera.CFrame = CamPart.CFrame

1 Like

okay ill try that real quick. I think I may have before and it didn’t work but I could be wrong

2 Likes

Yeah I just tried that and it still didn’t work

local CamPart = Workspace.CamPart
local Camera = Workspace.CurrentCamera

Camera.CameraType = “Scriptable”
Camera.CFrame = CamPart.CFrame

just to not write some type of words

1 Like

do you have any other camera scripts in your game? They can of course mess with the currentCamera.

I don’t think I’ve done non-triggered camera changes before. Will try it tommorow if your issue isn’t fixed.
In the meantime you could try to do WaitForChild on your variables to see if maybe the game hasn’t loaded the variables correctly.

1 Like

Yeah. @Coryiodine Try to do this with a WaitForChild:

local CamPart = Workspace:WaitForChild("CamPart")
local Camera = Workspace.CurrentCamera

Camera.CameraType = “Scriptable”
Camera.CFrame = CamPart.CFrame
1 Like

The game does put you in first person mode but I wasn’t sure if that’d effect it as it’s just moving the camera somewhere else, you know? but im not sure. But yeah If theres no solution tomorrow then ill still need help lol thanks

1 Like

okay ill try that out…(wants me to use 3.0 characters to reply so im adding this)

Then, if first person, do this:

game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson

Or do you really want the camera to be the same CFrame as the part?
Or you want it to be actually first person

1 Like

That worked! thanks man. I guess I have to remember to add waitforchild if my camera scripts act up.

1 Like

Credits to @youbigown tho

papapapapapapappaa

3 Likes

yep. Over time you will learn when to add WaitForChild for certain things.

1 Like

true. I can see it now in retrospect since it takes a while for it to load in all the parts for it to get to the one to use as a camera

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.