WaitForChild() on instance infinite yielding when instance exists

I have a module function that once called, will take the fake character of player1 (made when characterAdded which is connected to playerAdded) and weld it to player2.
the function would set the Welded/Carried value inside the player’s model to true.
I have a LocalScript that has a Changed connection with the Welded/Carried value.
When it is fired, it looks in workspace.carried (where all fake characters are parented to) and uses :WaitForChild(player.Name) to find their own character. (I’ve tried using :FindFirstChild() at first but it just returned as nil)
It then changes the CameraSubject of workspace.CurrentCamera to the fake character.

–error time!!
the script infinitely yields when WaitForChild() is called even when instance is there.
Or maybe the instance doesn’t exist for the client (or smth idk)
–Line 184-186 (infinite yield line)

elseif state.Value == "Carried" then
		workspace.CurrentCamera.CameraSubject = workspace["carried"]:WaitForChild(player.Name)
		end

images are taken on client side

devProblem1

devProblem2

TL;DR - the script is yielding infinitely even when instance exists (i think)

It will probably not resolve your issue, but :WaitForChild takes a number as a parameter which acts as a time-out for the yield.
It’s good practise to always add this.

Is the module’s function being fired on the server? Calling the carry function on just one client will only replicate those changes to the client that fired the function.

If the function is being called on the server, then I’m not really sure what the issue is at the moment without seeing any further samples of your code (any suspects that might have caused the issue)

It’s firing on the client if you look at the output.

Module is called by server to change the value, client does the connection for .Changed

Perhaps the value is being updated before intended?

Instead of using .Changed, use :GetPropertyChangedSignal(“Value”):Connect() as this limits the range of possible sources to just the value itself.

To expand on this, is it possible the .Parent property is being set after the .Changed event is being set?

This would set off the event before the fake character has been added, if I’m correct.

fake character is created when playerAdded event is fired (on server)

local function onPlayerAdded(player)
	player.CharacterAdded:Connect(fakeCharacter)
end

tried doing that, same results

Is the welded value set up in the fakeCharacter function?

Also I’d recommend using Attributes and :GetAttributeChangedSignal() as it’s more clean.

the welded value is in StarterCharacterScripts

(bruh)

never used them, ill look into it

insisted on using remoteevents instead
(roblox why)