NPC not turning with BodyGyro

I am trying to turn an NPC with BodyGyro to face a part. Every time I run the game, the NPC stays in place, without turning towards the desired part.


As you can see there is a range part welded to the humanoidrootpart, but that was intentionally put there. It does not seem to be causing the problem as the issue still persists even when I delete the range part.

Here is the script:

local npc = script.Parent
local humanoidrootpart = npc.HumanoidRootPart
local bodygyro = humanoidrootpart.BodyGyro
local goalbottom = workspace.Goalbottom

while true do	
	bodygyro.CFrame = CFrame.new(humanoidrootpart.Position,goalbottom.Position)
	
end		

In your code, there is nothing setting the Orientation.

See: BasePart | Roblox Creator Documentation

what do I set the orientation of?

HumanoidRootPart.

See: How can I set ONLY the orientation of the character? - #19 by AdaptabiI

The post you gave me shows how to rotate the humanoidrootpart’s joint. I want to know how to rotate the entire NPC altogether to face a part.

If you rotate the HumanoidRootPart (it is the root part of the character), the entire character will rotate.

1 Like

I apologize for the late reply. The reason why it’s not working is that you have yet to set the NPC’s network owner to nil. Here’s a snippet for you to use.

for _, v in pairs(npc:GetDescendants()) do 
			if v:IsA("BasePart") then 
				v:SetNetworkOwner(nil)
			end
		end