Camera not moving

Hello. So I have this portal transportation system in my game and I’m trying to move the camera while they are exiting the portal for a cutscene. But for some reason the code it not working.

Here is my code:

game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
	
game.Workspace.CurrentCamera.CFrame = game.Workspace.PortalCam.CFrame
game.Workspace.CurrentCamera.Focus = game.Workspace.World.PortalB.CFrame

(Portal Cam is the part that the camera moves to. And PortalB is one of the portals, in this case the exit portal.)

Sorry if I’m not being clear. If you want I can send a video of what I’m trying to do.

This is definitely in a local script right?

Yes. It is in a local script inside StarterGui.

1 Like

So, this is not happening at the start of the game right?

– knowing it is a portal

No. So the way I have the player teleport long distances is through a portal transportation system. I’m trying to move the camera while the player is exiting said portal. Would you like me to send a video of what I mean?

Yes please. I can see from there

robloxapp-20210909-1221341.wmv (1.5 MB)

As you can see When exiting the other end of the “Tunnel” The camera just stays in the tunnel but I’m trying to make it move to the side of the portal so the player can see themselves exiting. (If that makes sense. I’m not good at explaining things.)

Kind of like this:

This would be the general position of the camera while they are exiting the Tunnel.

(Obviously there would be another portal frame there too but I just have the portal there just for testing purposes.)

I might know a possible solution, but I’m unable to test it ATM.

repeat
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
until game.Workspace.CurrentCamera.CameraType == Enum.CameraType.Scriptable
	
game.Workspace.CurrentCamera.CFrame = CFrame.new(game.Workspace.PortalCam,game.Workspace.World.PortalB)

I can explain it if you want

So you think that the camera type isn’t changing?

I’ll test i out as soon as i can. Thanks!

I don’t actually know. I just put that there when I’m dealing with camera manipulation

Alright. Thanks! I will test it out as soon as I can. Thanks!

Hello. I tried your idea and unfortunately it did not work. I’m sorry for the trouble. Thanks!

you might need a wait(5) before starting the script

Is there an error in the output?

Try putting the localscript in StarterPlayer > StarterCharacterScripts

That would mean I want it to run when the game starts which is not the case.

There is probably either an error in the output, or the FOV (field of view) is too low for some reason. Try checking the FOV to see if it’s too low. It’s possible that something accidentally set it too low, making the camera practically unable to move

How would I do that? Sorry for the trouble

EDIT: There was an error. I accidentally did “=” instead of “==”. Let me fix that and get back to you guys.

EDIT 2: Still didn’t work. Sorry.

Just go to workspace, then go to camera which should be directly underneath it, then scroll down under the properties of the camera, and you should see a field of view setting in which you can change the FOV.

The FOV is 40. Is that too low?

It depends, if you want players to be able to see farther, make it higher, if you want them to only see a certain area, make it lower.