- What do you want to achieve?
I want to make a pet model show up in a viewport frame
-
What is the issue?
When I viewport the model, only one of the part is showing up on the viewport
Here is the viewport frame script:
function ShowViewport(objectName)
if petsFolder:FindFirstChild(objectName) and holder:FindFirstChild("Camera") then
if run ~= nil then
run:Disconnect()
end
local viewPort = holder.ViewportFrame
if viewPort:FindFirstChildOfClass("Model")then
viewPort:FindFirstChildOfClass("Model"):Destroy()
end
viewPort.CurrentCamera = holder.Camera
local clonedPet = petsFolder:FindFirstChild(objectName):Clone()
clonedPet.Parent = viewPort
clonedPet.PrimaryPart.CFrame = holder.Camera.CFrame * CFrame.new(0,0,-3)
run = RunService.RenderStepped:Connect(function(dt)
clonedPet.PrimaryPart.CFrame *= CFrame.Angles(0,dt,0)
end)
else
Instance.new("Camera",holder)
ShowViewport(objectName)
end
end
Yes, I also welded the parts together using a WeldConstraint
- What solutions have you tried so far?
I tried to anchor and unanchor the parts and tried changing the primary part
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.