Dummies load with missing limbs only sometimes

Hello, I’m slightly confused as to why my dummies are sometimes loading with missing limbs sometimes. The dummy they’re cloned from is waited for in the script using workspace:WaitForChild(“Modelhere”) but this doesn’t seem to have changed the situation

Any help is appreciated

plr = game.Players.LocalPlayer
RE = game.ReplicatedStorage.RemoteEvents.InitiateConversation

workspace:WaitForChild("PlrDummy"):WaitForChild("HumanoidRootPart")
workspace:WaitForChild("NPCDummy"):WaitForChild("HumanoidRootPart")
PlrDummy = workspace:WaitForChild("PlrDummy"):Clone()
NPCDummy = workspace:WaitForChild("NPCDummy"):Clone()
PlrDummy.Parent = script.Parent.PlayerViewport.PlayerWorldModel
NPCDummy.Parent = script.Parent.NPCViewport.NPCWorldModel

PlrDummy.PrimaryPart = PlrDummy:WaitForChild("HumanoidRootPart")
NPCDummy.PrimaryPart = NPCDummy:WaitForChild("HumanoidRootPart")

PCamera = Instance.new("Camera")
NCamera = Instance.new("Camera")
PCamera.Parent = script.Parent
NCamera.Parent = script.Parent
PCamera.CFrame = workspace:WaitForChild("DialougeCameraPosition").CFrame
NCamera.CFrame = workspace:WaitForChild("DialougeCameraPosition").CFrame

script.Parent.PlayerViewport.CurrentCamera = PCamera
script.Parent.NPCViewport.CurrentCamera = NCamera

Poses = game.Workspace.NPCPoses

“sometimes” meaning that isnt happening all the times, right?

i fixed something like this by adding a loop and checking if all parts arent nil

repeat task.wait() until part ~= nil
1 Like

Thanks, Though looking at this initially this looks like it might be expensive on performance if used over multiple scripts, Not 100% sure though

I believe I’ve resolved the issue by adding a task.wait() after the dummy rootparts are loaded

oh well, good luck with your game boss!