local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local HumanoidAnchor = char:WaitForChild("HumanoidRootPart")
HumanoidAnchor.Anchored = true
What I am trying to achieve is when the Player joins the game the humanoid will be anchored but this message shows on the output: Infinite yield possible on workspace.LL0YD01:WaitForChild("HumanoidRootPart") How do I prevent this from happening?

2 comments
The warning “Infinite yield possible” actually means a thread can potentially yield infinitely. This usually arises when you use the :WaitForChild() function, as it just waits theoretically indefinitely for an instance to be added , and when over 5 seconds have elapsed without the function returning an Instance, it returns the error.
Ah, okay. Is this a good thing or a bad thing and how do I prevent this from happening?