How to attach the camera to a part side

I don’t really know how to begin with this topic, to add more detail to the title how would I make the camera attach to a part side (for example attaching the camera to the front side so you would see what the front surface is facing) I’ve got this code that makes the camera focus on a part but it has limitations. you have to be on the same level as the part to see evenly and you see it a few studs away from the part. is there a way I can change it to attach the camera to the side of a part?

wait(5)
local cam = workspace.CurrentCamera
local player = game.Players.LocalPlayer
local FocusPart = game.Workspace.FocusPart

cam.CameraType = "Fixed"
cam.Focus = FocusPart.CFrame
1 Like

This should be Scriptable, not Fixed.

If you wanna look at the front surface, just use the CFrame property.

When I make the type Scriptable the camera keeps focusing on my character

ok so the second property of CFrame…
CFrame.new(Position, LookAt) you can use this to achieve it. For example, in ur case you wanna do CFrame.new(CameraPart.Position, CameraPart.Position+CameraPart.CFrame.LookVector)

3 Likes