How do you get rid of Infinite Yield Error?

Hi there. So I was creating a script that removes the forcefield of a player every single time they respawn, but it always shows an error “Possible Infinite Yield”. I know it means the child may never be found Therefore, the script is never-ending, but the forcefield should always appear every time a player’s character loads, so I think the error is unnecessary and I am trying to get rid of it.

character:WaitForChild("ForceField"):Destroy()

You don’t need to do this, just go to properties of the spawn location and set Duration to 0

image

2 Likes

I think you can just… set the forcefield time when players respawn to 0 instead of trying to find the forcefield itself

not completely sure which service has that but im guessing its starterplayer