Viewportframe won't render part inside of part

Hey developers,
I’ve tried making this a meshpart but it can’t combine the 2 mesh part textures and ends up looking weird.
It only shows the duck and not the duck’s hat with it.

What it should look like:

What it ends up looking like:
Capture

Code:

local Frame = script.Parent
local Duck = game.Workspace.Ducks:FindFirstChild(script.Parent.Parent.DuckName.Value):Clone()
Duck.Position = Vector3.new(0, 0, 0)
Duck.Orientation = Vector3.new(0, -180, 0)
Duck.Parent = Frame
local Camera = Instance.new("Camera")
Frame.CurrentCamera = Camera
Camera.Parent = Frame

Camera.CFrame = CFrame.new(Vector3.new(0, 0.70, 3.275), Duck.Position)
local count = -180

while wait() do
	Duck.Orientation = Vector3.new(0, count, 0)
	count += 2
	if Duck.Orientation == Vector3.new(0, -180, 0) then
		script.Parent.DestroyEvent:FireServer(tostring(game.Players.LocalPlayer.Name), tostring(script.Parent.Parent.Parent.Parent.Name))
	end
end

Thank you! (I accidently went to the wrong topic and posted there, so thats why you see this again. I deleted the old post. :slight_smile: )

1 Like

Has the pirate hat got it’s archivable turned off?

Nope. Should I turn that off??

No, it should be kept on as that property (when off) stops the object from being cloned.

1 Like

Okay found your problem:

You are setting to position and orientation of the duck and leaving the hat behind.

I thought so, but I also thought that weld constraints would move with it, but it did not.
I also tried using a model instead of a part and nothing changed.

WeldConstraints only work if the duck is placed in a WorldModel in the ViewPortFrame.

Ohh, okay! I will test that out now! Thanks! :slight_smile:

1 Like

Just make sure the Duck is anchored in the WorldModel and the hat is not.

1 Like

Hey, it works! Thank you. Now all I have to do is make the hat rotate with it. :slight_smile:

1 Like

Hey so this works, but the hat is offset now and is behind the duck.
Do you know why this is happening?

Try turning off CanCollide for the hat.

1 Like

Sorry for late response, nope. It doesn’t fix it.