Bone follow/face player

Hello there!

I have a question about creating skinned mesh custom characters specific bones face a player or a target. I’m looking for something similar to how R6/R15 rigs heads orient toward the player’s camera, but applied to individual bones.

I’ve already highlighted the bones in Blender that need to move. How would you recommend approaching this?

Any advice or ideas would be greatly appreciated.

Could we use IKControl if so, how?

I know it is hacky, but you could have like 128 different models and a 2d table, where the two indexes are the pitch and yaw.

If there is a way to set the time of an animation, you could just make a long animation covering all rotations and just set the time accordingly.

You could just make the head seperate from the main body.

That’s pretty easy
Bones are basically attachments.
You can edit the WorldCFrame of the bone to face the player.
Just make sure you selected the right bone.

IKControl only works for Motor6D rigs.

What if the bone itself isnt directly straight and it’s little bit tilted, do I setup an offset or?

Yeah or you can try using .Transform instead

Alright, This is what I’ve managed to do, This works flawlessly even on the server side, But I’d rather handle it on the client. Anyways, Here’s the code

The offset is just the Orientation of the bone, but inverted, You could play around with the offset and get a much more accurate facing.

local rs = game:GetService("RunService")
local npc = script.Parent
local target  = game.Workspace.Part

local Bones = {
	Neck1 = {
		Bone = npc:FindFirstChild("Neck1", true);
		Offset = CFrame.Angles(-math.rad(39.548),0,0);
	};
}

rs.Heartbeat:Connect(function()
	for _, data in pairs(Bones) do
		local bone = data.Bone
		if bone then
			local look = CFrame.lookAt(
				bone.WorldPosition,
				target.Position
			)

			bone.WorldCFrame = bone.WorldCFrame:Lerp(look * data.Offset, 0.15)
		end
	end
end)


Make sure to implement a some sort of MaxYaw/MaxPitch so the bones don’t get squished :P, Thanks @Yarik_superpro for the help!