Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Infinite yield possible error anyone can help?

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.

4 comments

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?

0

Looking at your pfp I'm assuming it's not, lmao

0

I don't get it my game is using r15. What and why is giving this error?

0

R15 has an "UpperTorso" not a "Torso".

2 answers

✓ Accepted answer

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

3 comments

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

0

Seriously..?

0

im new to trying to explain stuff lol

: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!

This discussion is preserved as it was. New answers, comments, and votes are closed.