Error attempting to load character model to rig

  1. What do you want to achieve?
    I am trying to make a rig that loads the local player’s character model, and faces towards them

  2. What is the issue?
    The rig faces the character fine, however, attempting to load the rig gives this error:
    HumanoidDescription is not a valid member of Humanoid “Workspace.ObbyParts.menacingman1.Humanoid” - Client

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have searched on the forums for loading characters to rigs, however I have not found anything useful.

Script:

local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char.Humanoid
local npc = script.Parent
local npchumanoidrootpart = npc.HumanoidRootPart
local npchumanoid = npc.Humanoid
local Players = game:GetService("Players")

npchumanoid.HumanoidDescription = Players:GetHumanoidDescriptionFromUserId(player.UserId)


while true do
	local char = player.Character or player.CharacterAdded:Wait()
	local humanoidrootpart = char.HumanoidRootPart
	
	npchumanoidrootpart.CFrame = CFrame.new(npchumanoidrootpart.Position, char.Head.Position)
	wait(0.1)
end

have you tried npchumanoid:ApplyDescription(Players:GetHumanoidDescriptionFromUserId(player.UserId)?

I tried it, but I got the error message
Humanoid::ApplyDescription() can only be called by the backend server - Client - LookAt:9

I searched it up and this is what I found

You probably have to create the NPC on the client. A fast solution is to move the script outside of the NPC and then clone it and destroy the old one.

local serverNpc = script.Parent.NPC
local clientNpc = serverNpc:Clone()
serverNpc:Destroy()
clientNpc:ApplyDescription(Players:GetHumanoidDescriptionFromUserId(player.UserId)

This isn’t the best solution because now the client will have its own version of the NPC that won’t replicate to other players. If you can, I would probably do this on a server script.

What you’re describing will probably work fine for me, however, when trying the code I get the following error:

Humanoid::ApplyDescription() DataModel was not available - Client - LookAt:10

oh, I think you have to parent the clone back in

Unfortunately, the same error has occurred

does this work?

local serverNpc = script.Parent.NPC
local clientNpc = serverNpc:Clone()
clientNpc.Parent = serverNpc.Parent
serverNpc:Destroy()
clientNpc.Humanoid:ApplyDescription(Players:GetHumanoidDescriptionFromUserId(player.UserId)