'Infinite yield possible ...' has started FLOODING my output out of the blue

My game experience has recently started ‘infinite yielding’ everything and giving the result to the output.

I have ZERO idea as to why this happened, it’s been happening ever since I launched studio one day.
There are ZERO issues in the code, as this started happening when i wasn’t doing even the slgihtest amount of coding (importing models)

This seriously starting to annoy me as there is no reason for this to happen.

2 Likes

the script runs before your character spawns, it could be because of your internet speed

1 Like

i’ve tested this both in studio and the actual game, it happens in both
there’s no way a script located inside the character can run before the character fully loads, is there?

1 Like

oh then idk, this usually only happens if something doesnt load or if it doesnt exist at all

1 Like

funnily enough i’ve just noticed this only happens whenever i load into the map (press the play button), otherwise there is no infinite yields

i’m crying

If this doesn’t affect gameplay itself, the WaitForChild() method can take a second argument (a number) that determines how many seconds have to pass before sending the warning. You can set this second argument to math.huge so it doesn’t flood the output!

1 Like

local ns = Workspace:WaitForChild(“notsad2”)
local gv = ns:WaitForChild(“GameplayValues”)

And so on..


Workspace.notsad2:WaitForChild(“GameplayValues”)
Infinite yield possible on 'Workspace.notsad2:WaitForChild(“GameplayValues”)

missed notsad2 or something is spelled wrong or not there.

image
this literally happens with instances that are currently on screen (vFists as an example)
it’s starting to annoy me and i’m starting to believe this is just a bug

local character = player.Character or player.CharacterAdded:Wait()
local gameplayValuesFolder: Folder = character:WaitForChild("GameplayValues")

gameplay values automatically gets created for the character everytime it spawns

Pretty sure this happens just to make you aware that if it doesn’t find a part, it’ll pause the script forever. To fix it, just shove a maximum wait duration as the second parameter, such as

local Part = script:WaitForChild("Part", 10) -- will only wait for 10 seconds.
2 Likes

I’ve had a similar issue, I solved it by turning off Streaming Enabled in the Workspace’s properties?

Also for most of your variables using :WaitForChild() isn’t needed, especially after you turn off Streaming Enabled, but that is IF turning off Streaming Enabled actually works.

local character = player.Character or player.CharacterAdded:Wait()
This doesn’t mean the character is fully loaded. In fact, it isn’t.
The player’s HumanoidDescription is still loading, and that takes a bit more time.
Deeper references in the hierarchy are not all loaded at this exact moment.
Almost every answer here says “wait longer”… have you tried waiting longer?

You also said “out of the blue” .. what did you just change?

You can use repeat task.wait to make the script wait for whatever your referencing is loaded in.
repeat task.wait() until character:WaitForChild("GameplayValues")

1 Like

try turning off StreamingEnabled

Given the other errors in the output I’m going to hazard a guess and say your game’s instance hierarchy isn’t as you think it is.

nothing, i changed nothing

i said this issue started happening when i wasn’t even coding, but importing weapon models and then testing their animations

Looks to me like your character is loading multiple times. I think this because you will only get 1 infinite yield warning but your game says (x2).

Since you have everything under the character, you will have a new script every time you respawn. And if it starts waiting for the rootpart then gets destroyed I’m not sure if that cancels the yield.

Do you have a custom spawning system? If you do then I’m sure the problem is there.

If not then:
Does this happen when you publish and try the game on roblox?
Does the game still work despite these warnings?
Is there any way your character could be falling/dying/being destroyed when they first spawn in?

You said the only thing you were doing was animations.

Did you copy the players character while playing then pasted it into studio? I could imagine you did this because it’s an easy way to get the rig with the gun model already welded by a script. If so then delete all scripts from your animation rigs.

nots please just use the second argument :sob:

Just set it to 1000 or something, PLEASE :sob:

um Im pretty sure this is exactly what WaitForChild does . . . it waits for the referenced thing to load in. Like if you were to actually test it, this loop would only run once as the WaitForChild would yield it, theres no point in the repeat loop :sob:

unless theres something Im missing ofc

if you did want to use the repeat loop you should use FindFirstChild instead:

repeat task.wait() until Object:FindFirstChild('ChildName')

ofc this is the exact same thing as just using WaitForChild,

1 Like

This would be so much easier if we could see the script and a picture of the hierarchy.
WaitForChild() is one of the easiest errors to fix. Most of the time it’s a spelling error or a timing error.
With nothing to work with you’ll just get speculation..

no, it was nothing related to the character, it was viewmodel animations


yeah, but the issue didn’t exist until recently, and i haven’t touched the spawning code in ages


i AM, i literally AM
i set the timeout to like 30 seconds and it STILL doesn’t find anything


i’ve said this so many times already :((
the issue appeared when i wasn’t even coding, i wasn’t editing any hierarchies or anything, i was just adding new viewmodels

funnily enough, i get an infinite yield that doesn’t even point to a script:
image

and line 31 in ‘Ability’ is blank: