Cant set NetworkOwnership of a HumanoidRootPart

As the title says, i cant figure out how to set the network ownership of the humanoidrootpart of my NPC

setNetworkOwnerOfModel(NPC, closestPlayer)

simply doesnt work and looping through the entire character model

for _, descendant in pairs(model:GetDescendants()) do
		if descendant:IsA("BasePart") then
			local success, errorReason = descendant:CanSetNetworkOwnership()
			if success then
				descendant:SetNetworkOwner(networkOwner)
				print("SET")
			else
				error(errorReason)
			end
		end
end

sets the networkOwnership for all baseParts under the NPC model but not the HumanoidRootPart.
I really need to figure out a way to do this as i am using AlignOrientations inside NPC HRPs to orient them towards the closest player. As its the most performant way to handle 50+ NPC rotations without bombarding the server.

2 Likes

This specific topic has already been discussed in another post previously: Cannot set network ownership of character humanoidrootpart?

Documentation that could help you:

Brief answer: You can’t manually set the NetworkOwner of the HumanoidRootPart if the model has a Humanoid, because Roblox automatically forces it to the server as it’s the physical root of the character.

I didnt wanna do the Heartbeat thing as it definitely isnt the most elegant solution. But it seems to be the only thing that works. Big thank frend.

1 Like

You’re welcome! Don’t hesitate to ask if you have any other questions. :heart_hands:t2::white_heart:

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