Infinite yield wait for child

So basically i am making this rig thing for my vr game so it can be multiplayer. So i create the rig by doing this:

local Rig = game.ReplicatedStorage.Rig:Clone()
Rig.Parent = game.Workspace
Rig.Name = game.Players.LocalPlayer.Name.."Rig"

but my problem is i dont know how to identify it in other scripts, because when i do this:

game.Workspace:WaitForChild(Player.Name.."Rig")

it just hits me with an infinite yield… help is appreciated! I would love to play my vr game with friends by tonight or something, Thanks!

2 Likes

It looks like you’re creating the rig in a local script, so only that client will be able to see and reference it. You want to have the server create the rig with a regular script, and then assign it to the client somehow.

1 Like

The way you are scripitng this makes me think it is a local script. A local script is only client sided, so when the rig is cloned, only the client will see it. You can fire a remote event or function i forgot the difference and have the player name be one of the things in the (parenthesis) if you know what im talking about.

I totally forgot about client to server stuff so I’ll try this out when I get on, thanks! I’ll mark solution if it works