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.