Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Infinite yield possible error anyone can help?

Asked by 5 years ago

So I'm making my game but it gives me this error. Well, I don't think its an error because it is in orange but I don't know. Heres the error:

Infinite yield possible on 'Workspace.Admiral2001:WaitForChild("Torso")

If you know how to fix this I would be grateful.

0
It's waiting for "Torso" to be a child of 'Admiral2001' but after some time it throws this warning. Are you sure 'Admiral2001' is an R6 rig type? xPolarium 1388 — 5y
0
Looking at your pfp I'm assuming it's not, lmao xPolarium 1388 — 5y
0
I don't get it my game is using r15. What and why is giving this error? admiral2001 36 — 5y
0
R15 has an "UpperTorso" not a "Torso". xPolarium 1388 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

Well the issue is that it's waiting for something it cant find and that is because there is no "torso" in r15, there is an UpperTorso and a LowerTorso

0
this isnt really right, since its warning that it may just wait forever, and how would :WaitForChild() know if it exists or not lol User#23365 30 — 5y
0
Seriously..? Ziffixture 6913 — 5y
0
im new to trying to explain stuff lol DesiredRep 75 — 5y
Ad
Log in to vote
0
Answered by
Ziffixture 6913 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

:WaitForChild() is a Yeild function. It’s usually used by Scripters who are looking for a Child of a Parent that they’re unsure is existent. In this case you’re looking for the Characters Torso. There is usually one scenario that is causing your warn. Either your Character is an R15 Rig. Meaning the build of your Character is different thus having the function Yeild until it exists. Which may be forever. Try adding an alternative statement to this reference to have compatibility between both Rigs

local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character
local Torso = Character:WaitForChild("Torso") or Character:WaitForChild("UpperTorso")

You like to Index the UpperTorso as a. It’s apparent to R15 only, b. It’s the Torso the Head attaches to, meaning it’s mostly understood as the Torso. There is a LowerTorso too, this is slightly above the waistline.

Hope this helps! If so, don’t forget to accept this answer and upvote!

Answer this question