Rendering an object before it is shown

I am making a player trail with viewports, and sometimes when more than 4 trails are made, it will not load the character’s clothing correctly. how would I fix this?


SCRIPT;

	if Reservance(1,extrainfo):IsA("Player") then
			local test = game.Players.LocalPlayer.Character:WaitForChild("Torso")
			if test ~= nil then
				local magni = (test.Position - Reservance(1,extrainfo).Character.Torso.Position).magnitude
				if magni <= 95 then
			local chr = Reservance(1,extrainfo).Character:Clone()
			chr.Parent = game.Lighting.CloneLoader
			chr.Name = "Trail"
			chr:BreakJoints()
			local standcheck = chr:FindFirstChild("Stand")
			if standcheck ~= nil then
				standcheck:Destroy()
			end
			chr.Humanoid.DisplayDistanceType = "None"
			chr.Humanoid.Name = "TheHumanoidForDistractions"
			local time = 0.45
			if Reservance(2,extrainfo) == nil then
				time = 0.45
			else
				time = Reservance(2,extrainfo)
			end
			game.Debris:AddItem(chr,time)
			wait()
			chr.Parent = script.Parent.Viewport.ViewportFrame
			local chrparts = chr:GetDescendants()
			for i=1, #chrparts do
				if chrparts[i]:IsA("BasePart") then
					chrparts[i].Anchored = true
					chrparts[i].CollisionGroupId = 1
					local tweener = game.TweenService:Create(chrparts[i],TweenInfo.new(time - 0.03,Enum.EasingStyle.Cubic,Enum.EasingDirection.Out,0,false,0),{Transparency = 1})
					tweener:Play()
				end
				if chrparts[i]:IsA("ForceField") then
					chrparts[i]:Destroy()
				end
				if chrparts[i]:IsA("Decal") or chrparts[i]:IsA("Texture") then
					local tweener = game.TweenService:Create(chrparts[i],TweenInfo.new(time - 0.03,Enum.EasingStyle.Cubic,Enum.EasingDirection.Out,0,false,0),{Transparency = 1})
					tweener:Play()
				end
			end
			end
		end
	end
1 Like

Have you tried WaitForChild("Shirt") and WaitForChild("Pants") before parenting the cloned character?

Yes, however I forgot to add how instead of the body parts appearing smooth, they’re studded like this.
image
Even though the humanoid is not absent.