as the title suggests, I am getting a warning of an infinite yield possible on WaitForChild(“Humanoid”)
19:55:48.472 Infinite yield possible on 'Players.BallOTinfoil.PlayerGui.SurfaceGui.ViewportFrame.WorldModel.BallOTinfoil:WaitForChild("Humanoid")' (x3047) - Studio
this isn’t a call from my script so i have absolutely no idea how to fix this.
some context for the script;
I’m making a mirror using a viewport frame with relative success. and after running into a bunch of issues i’m at the stage i am now.
the current script copies all the player’s limbs into a model inside the viewport frame
however this also includes any scripts inside the character and everything else
so maybe that’s the issue…?
I also am not the greatest at scripting so all of my attempts at that have failed…
anyways, thanks in advance!
script down below:
local gui = script.Parent
while not gui.Adornee do
task.wait()
end
local Adornee = gui.Adornee
local AdorneeParent = Adornee.Parent
local ViewportCamera = Instance.new("Camera")
ViewportCamera.CFrame = AdorneeParent.CameraDirection.CFrame
ViewportCamera.FieldOfView = 70
gui.ViewportFrame.CurrentCamera = ViewportCamera
local RunService = game:GetService("RunService")
local DetectZone:BasePart = gui.Adornee.Parent.Detection
RunService.Heartbeat:Connect(function(step)
gui.ViewportFrame.WorldModel:ClearAllChildren()
for _,player in game.Players:GetPlayers() do
for _,part in player.Character:GetChildren() do
local clone = part:Clone()
local cloneModel = Instance.new("Model")
cloneModel.Parent = gui.ViewportFrame.WorldModel
cloneModel.Name = player.Name
clone.Parent = cloneModel
end
end
end)