-
What do you want to achieve?
A front view of my model in a viewportframe
-
What is the issue?
I’m creating a camara and setting a certain Cframe to it to make the model visible, but the rotation of the model carrries over to the camara, which keeps making the view from the back
-
What solutions have you tried so far?
Tried turning the camera, setting it’s orientation, I either amd eit wrong or it just didn’t work
local function CheckLoadType(Rig, Container)
Rig.HumanoidRootPart.CanCollide = false
Rig:SetPrimaryPartCFrame(CFrame.new(0, 10, 0) * CFrame.Angles(0, math.rad(180), 0)) --CFrame.Angles(0, math.rad(180), 0)
if Rig.Name ~= LoadType then
Container.Visible = false
end
local ViewportFrame = Container.ViewportFrame
if not ffc(ShowCaseFrame, "Camera") then
local Camera = Instance.new("Camera")
Camera.Parent = ShowCaseFrame
ShowCaseFrame.CurrentCamera = Camera
local modelCFrame, modelSize = Rig:GetBoundingBox()
local maxDimension = math.max(modelSize.X, modelSize.Y, modelSize.Z)
Camera.CFrame = modelCFrame * CFrame.new(0, 0, maxDimension / 1.25)
Camera.CFrame = Camera.CFrame * CFrame.Angles(0, 0, 0)
Camera.Focus = modelCFrame
end
local Camera = Instance.new("Camera")
Camera.Parent = ViewportFrame
ViewportFrame.CurrentCamera = Camera
local modelCFrame, modelSize = Rig:GetBoundingBox()
local maxDimension = math.max(modelSize.X, modelSize.Y, modelSize.Z)
Camera.CFrame = modelCFrame * CFrame.new(0, 0, maxDimension / 1.25)
Camera.CFrame = Camera.CFrame * CFrame.Angles(0, 0, 0)
Camera.Focus = modelCFrame
end
Have you tried changing the orientation AND changing the Z axis into the negatives for example:
Camera.CFrame = modelCFrame * CFrame.new(0,0,-maxDimension / 1.25) + CFrame.Angles() -- Set the angle here
I hope I helped you with your problem.