Camera ViewportFrame Orientation Help

Hello, I am currently trying to make a camera face the front of a model’s primary part, though it only shows the top. Below, I have linked some images of what I am trying to accomplish.

Left: What I want to happen Right: What happens
image

Example: (sorry for the bad drawing lol)
image

Script:

local ViewportCamera = Instance.new("Camera", button)
	ViewportCamera.CameraType = Enum.CameraType.Scriptable
	ViewportCamera.FieldOfView = 100
	ViewportCamera.CFrame = CFrame.new(Vector3.new(0, 3, 1), Vector3.new(0, 1, 0))
	button.CurrentCamera = ViewportCamera
	
	local model = button:FindFirstChildWhichIsA("Model")
	model:SetPrimaryPartCFrame(CFrame.new(0, 0, 0))
	model.Parent = button

I have tried tweaking the camera both in the script and using the properties tab while playing, though I have noticed that the position and orientation only moves 2 dimensionally.

Do you mean to switch the X and Y/Z and Y values for the CFrame position?

ViewportCamera.CFrame = CFrame.new(Vector3.new(3, 0, 1), Vector3.new(0, 1, 0))
1 Like

Hello! Thank you so much for responding! This did fix it thank you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.