NPC falling when spawning

When i spawn npc he can just fall over like hes humanoid state is platform standing with zero mass, but after few seconds npc will stand up like nothing happend.

HumanoidRootPart is not massless, and the humanoid state is always running (as should be)

local newNPC = NPC:Clone()
newNPC.PrimaryPart.CFrame = button.CFrame:ToWorldSpace(CFrame.new(-5, 0.35, 0))
newNPC.Parent = workspace.Characters.NPCs

Just add an event listener, for position to be specific, to check if the position is being changed by the goofy ahh robloxx physics or the script…

1 Like

I added function that setting the network owner of the model to nil, cuz when model were replicating to workspace it was searching for the network owner

function

function setModelNetworkOwner(model, networkOwner)
	for _, descendant in pairs(model:GetDescendants()) do
		-- Going through each part of the model
		if descendant:IsA("BasePart") then
			if descendant:CanSetNetworkOwnership() then
				descendant:SetNetworkOwner(networkOwner)
			end
		end
	end
end

updated script

local newNPC = NPC:Clone()
newNPC.PrimaryPart.CFrame = button.CFrame:ToWorldSpace(CFrame.new(-5, 0.35, 0))
newNPC.Parent = workspace.Characters.NPCs
setModelNetworkOwner(newNPC, nil)
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.