Unable To Position The Camera Correctly

I am trying to face the camera to the front of the character.
Although, I either see nothing, or see the back of the character.
image
I have tried doing so many different things but with no success.
Attempted:

Thank you

My Current Code:

	local ViewportCamera = Instance.new("Camera")
	ViewportCamera.CameraType = Enum.CameraType.Scriptable
	ViewportFrame.CurrentCamera = ViewportCamera
	ViewportCamera.Parent = ViewportFrame
	objectClone.PrimaryPart.CFrame = CFrame.new(0,0,0)
	ViewportCamera.CFrame = objectClone.Head.CFrame
	ViewportCamera.CFrame = ViewportCamera.CFrame + -objectClone.Head.CFrame.LookVector*Vector3.new(2,2,2)

Try manually moving the character to workspace and then rotate it 180 degrees so that it faces the opposite way after that put it back to where it was before (under viewportframe) and run the script. It should work then.

1 Like

Try replacing the last two lines with

ViewportCamera.CFrame = objectClone.Head.CFrame * CFrame.new(2, 2, 2) * CFrame.Angles(0, math.rad(180), 0)

Ends up with this
image

This looks pretty close to what you want:
ViewportCamera.CFrame = objectClone.Head.CFrame * CFrame.new(0, -0.25, -2.5) * CFrame.Angles(0, math.rad(180), 0)
image

2 Likes

Its perfect mate! Thanks, the part that had me bummed most of the time was rotating the camera so this helped!