Rotate a motor 6d along one axis towards a target

I have an npc and I want its head to rotate to face the player, however, I only want its Y axis to change. The code I have works fine when have it face the npcs position, but as soon as I try to isolate it to only the Y it stops working. Obviously I’m not doing something correctly here. Is what I want even feasible?

local resetPart0 = (NPC.Neck.HeadHolder.Part0.CFrame *CFrame.new(0,NPC.Neck.Size.Y/2,0)):Inverse()
					local desiredPart1CFrame = CFrame.new((NPC.Neck.Position-Vector3.new(0,NPC.Neck.Size.Y/2,0)), Vector3.new(Aggro.HumanoidRootPart.Position.X+10,Aggro.HumanoidRootPart.Position.Y,Aggro.HumanoidRootPart.Position.X+10))

					NPC.Neck.HeadHolder.C0 = resetPart0 * desiredPart1CFrame

nevermind. I clearly lack the ability to think.

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