Making NPCs heads rotate towards the player

So basically, what I want is simple.

I want NPCs to look towards a player when they get close, I have tried following this post (And many others) with no success, as the NPCs head was rotated backwards and usually clipping into the torso.

I’m no expert (or anything really) when it comes to messing with C0 and CFrames, so debugging has been… problematic and difficult.

If I could get any help with this, that would be greatly appreciated, thanks.

Also, if it helps, I am using R6 Rigs and want only the head to rotate, not the whole body.

1 Like

Here’s the calculation for the C0 property I got from this post that works fine with R6 rigs:

local CFrame0 = Neck.C0 -- This should only be defined once
Neck.C0 = CFrame0 * CFrame.Angles(0, 0, ((NPC.Head.Position - Player.Character.PrimaryPart.Position).Unit):Cross(NPC.PrimaryPart.CFrame.LookVector).Y)

Thank you so much, I nearly went insane looking for a solution.

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