Z3tsa
(Zetsa)
#1
-
What do you want to achieve?
Create a ViewportFrame inside an ImageLabel to show a model.
-
What is the issue?
The Camera object isn’t showing anywhere in the explorer but I can print the parent name of it.
-
What solutions have you tried so far?
Changing the camera parent.
local ViewportFrame = Instance.new('ViewportFrame')
local ViewportFrameCamera = Instance.new("Camera", ViewportFrame)
local UICorner = Instance.new('UICorner')
ViewportFrame.CurrentCamera = ViewportFrameCamera
ViewportFrame.BackgroundTransparency = 0
UICorner.CornerRadius = UDim.new(1,6)
UICorner.Parent = ViewportFrame
ViewportFrameCamera.CFrame = CFrame.new(Vector3.new(0, 2, 2), ViewportFrameModel.Handle.Position)
ViewportFrameModel.Parent = ViewportFrame
ViewportFrame.Parent = Slot
print(ViewportFrameCamera.Parent.Name)
This code prints ViewportFrame but there is no camera in the ViewportFrame.
Wyv_n
(Wyvern)
#2
local ViewportFrame = Instance.new('ViewportFrame')
local ViewportFrameCamera = Instance.new("Camera", ViewportFrame)
local UICorner = Instance.new('UICorner')
ViewportFrame.CurrentCamera = ViewportFrameCamera
ViewportFrame.BackgroundTransparency = 0
UICorner.CornerRadius = UDim.new(1,6)
UICorner.Parent = ViewportFrame
ViewportFrameCamera.CFrame = CFrame.new((ViewportFrameModel.Handle.CFrame * CFrame.new(0, 2, 2)).Position, ViewportFrameModel.Handle.Position)
ViewportFrameModel.Parent = ViewportFrame
ViewportFrame.Parent = Slot -- make sure slot is inside or is a ScreenGui or whatever gui you want
print(ViewportFrameCamera.Parent.Name)
Z3tsa
(Zetsa)
#3
Slot is inside a frame object.
bnxDJ
(bnx)
#4
Try setting the parent of the camera manually
system
(system)
Closed
#5
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.