Models become visible in Viewportframe only after moving them to workspace


I’m trying to do something like a character select menu with preview, the models are located in workspace first, and are then cloned over to the viewport frames.

Problems I have:

  1. But the models are not visible and have to be moved to workspace and back for them to show up.
    They also only show up without moving them if I don’t change their position at start
    image
    Seen in this picture, where the original model is moved by 1 stud, while the other models are moved several studs (The script changes their position anyways)
  2. I want to have animations for the models, but they only play when moving them to Workspace and back.

Script I use to change the positions + Clone then

local function UpdateRig(RigWS)
		local Container	=EmptyContainer:Clone()
		Container.Name	="Container"
		Container.Parent=OutfitsFrame
		local RigClone	=RigWS:Clone()
		RigClone.HumanoidRootPart.CanCollide = false
		RigClone.PrimaryPart.CFrame = CFrame.new(2, 3, 8) * CFrame.Angles(0, math.rad(180), 0)
		RigClone.Parent=Container.ViewportFrame
	end

I want to add, that when looking at the positions in the explorer everything seems right, but the viewport frames don’t reallyy detect this change

1 Like

I think you have to add a camera to the viewpoint frame and set the current camera in the viewpoint frame to the camera you added.

image

image
Tried it and it works, but now the thing with the animations is left, as it looks very boring if the rigs stand like that

local function UpdateRig(RigWS)
	local Container = EmptyContainer:Clone()
	Container.Name = "Container"
	Container.Parent = OutfitsFrame
	local RigClone  =RigWS:Clone()
	RigClone.HumanoidRootPart.CanCollide = false
	RigClone.PrimaryPart.CFrame = CFrame.new(2, 3, 8) * CFrame.Angles(0, math.rad(180), 0)
	RigClone.Parent=Container.ViewportFrame


	local anim = (your anim id)
	local playAnim =  RigClone.Humanoid:LoadAnimation(anim)

	playAnim.Looped = true
	playAnim:Play()
end

Idk why spaces aren’t working but this should be it.

1 Like

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