I’ve been fiddling with my script for numerous hours now trying to get an R6 humanoid rig’s neck motor to follow my character’s head position around in game.
To sum it up real quick, I’m trying to get an R6 humanoid’s head (the npc’s head) to follow my character’s head position around in game at all times. I’ve come close multiple times but this task has shaved valuable time away and I need to ask someone who is more knowledgeable than me.
Here is what I’ve been working with. I’ve researched countless times and I’m still unable to figure out why the head refuses to look at my character’s head. The code below rotates the head to the left about 90 degrees. It is not pointing towards the origin, I’ve tested it with different rotations and it turns its head to the left.
Looking for a simple and quick solution.
wait(2.5) local stare = game.Workspace.StaringEntity local neck = stare.Torso.Neck local char = game.Players.LocalPlayer.Character local yOffset1 = neck.C1.Y local yOffset0 = neck.C0.Y neck.C1 = CFrame.new(0, yOffset1, 0) neck.C0 = CFrame.new(0, yOffset0, 0) local direction = CFrame.lookAt(neck.C0.Position, char.Head.Position) --This is what should be controlling the npc's head to look directly at mine but doesn't work properly game:GetService("RunService").RenderStepped:Connect(function() neck.C0 = direction end)
This is probably super easy to accomplish but I have a very basic understanding of Motors, CFrames, etc.
Thanks for reading, I appreciate that.