Changing camera pos

So if I have a brick in workspace, how do I set my view to that? Like I am that brick now, and I am changing my camera position?
Also, how would I make it so you cannot move your camera around, you can just see what that brick can see?

https://developer.roblox.com/en-us/articles/Camera-manipulation

Every client has a camera called CurrentCamera in workspace. You can just set the CFrame to that particular part.

wait(); -- Without it will cause "ActivateCameraController did not select a module."
local camera = workspace.CurrentCamera;
local cameraPart = workspace:FindFirstChild("CameraPart");
camera.CameraType = Enum.CameraType.Scriptable;
camera.CFrame = cameraPart.CFrame;

Ok, so how do I return it to the player?
I did camera.CFrame = workspace.campart.CFrame
So what CFrame will I need to do to return it to the player?

Change the can type back to normal I believe

Setting the CameraType to Custom should return back to the player.

camera.CameraType = Enum.CameraType.Custom;
1 Like

Semicolon needed?
None of my script has any…

No semi-colons aren’t requied. That’s just a personal preference.