Help with positioning the camera

startergui>screengui>viewportframe>localscript

local script:

local viewportframe = script.Parent
local camera = Instance.new("Camera")
viewportframe.CurrentCamera = camera
camera.Parent = viewportframe
local part =  game.Workspace.Dummy
part.Parent = viewportframe
camera.CFrame = CFrame.new(Vector3.new(-10, 10, 10), part.Head.Position)

Screenshot (179)

You can try and guess the numbers until you get it right but I recommend putting a part in front the character and position it to where you want the camera to be and then just add the camera to it

1 Like

i tried the 2nd solution and it worked thanks

1 Like

Remember to use the lookAt constructor function when constructing a CFrame value from two Vector3 values.

camera.CFrame = CFrame.lookAt(part.Head.Position + Vector3.new(0, 0, -10), part.Head.Position)
1 Like