#[Solved] Fallowing Dummy Head

1 messages · Page 1 of 1 (latest)

slender pewter
#

I want to create an dummy (NPC) which stays absolutely still but his head always fallowing you.

Made rig (R6) and put this script inside and yeah the head is fallowing me correctly but the torso moves with the head which i don't want to.

I want just the head fallow you and the torso stays still as the other parts of the body.

#

Script:

copper fractal
#

local dummy = script.Parent
local head = dummy:FindFirstChild("Head")
local torso = dummy:FindFirstChild("Torso")
local neck = torso:FindFirstChild("Neck") -- The Motor6D connecting Torso and Head

-- Anchor all BaseParts except Head (optional for stability)
for _, part in pairs(dummy:GetChildren()) do
if part:IsA("BasePart") and part ~= head then
part.Anchored = true
end
end

local function trackPlayer()
while true do
local player = game.Players:GetPlayers()[1]
if player then
local character = player.Character
if character then
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if humanoidRootPart and neck then
local lookAtPos = humanoidRootPart.Position
local headPos = head.Position
local direction = (lookAtPos - headPos).Unit

                -- Calculate only the rotation needed
                local newCFrame = CFrame.lookAt(headPos, headPos + Vector3.new(direction.X, 0, direction.Z))
                
                -- Update Neck.C0 to rotate the head
                neck.C0 = torso.CFrame:ToObjectSpace(newCFrame)
            end
        end
    end
    task.wait(0.1)
end

end

task.spawn(trackPlayer)

sweet stoneBOT
#

studio** You are now Level 2! **studio

copper fractal
#

Do you want it to just look at one person or like each person who sees it it’s looking at them

#

If that then it’s better if you do a local script and modify it

slender pewter
#

So to change the script to local

#

Inside the dummy

copper fractal
#

Local script version

local dummy = workspace:WaitForChild("Dummy") -- Replace with your dummy's name
local head = dummy:WaitForChild("Head")
local torso = dummy:WaitForChild("Torso")
local neck = torso:FindFirstChild("Neck")

local player = game.Players.LocalPlayer

local function trackLocalPlayer()
while true do
local character = player.Character or player.CharacterAdded:Wait()
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if humanoidRootPart and neck then
local lookAtPos = humanoidRootPart.Position
local headPos = head.Position
local direction = (lookAtPos - headPos).Unit

        local newCFrame = CFrame.lookAt(headPos, headPos + Vector3.new(direction.X, 0, direction.Z))
        neck.C0 = torso.CFrame:ToObjectSpace(newCFrame)
    end
    task.wait(0.1)
end

end

task.spawn(trackLocalPlayer)

#

Yeah

#

For local dummy you could do script.parent instead

#

I think

#

I’m on my phone rn

slender pewter
#

Hmm now absolutely don't work

#

Lol

slender pewter
copper fractal
#

Ok hold on

slender pewter
copper fractal
#

Ima get in ma laptop so I can make it for you

#

My fault

slender pewter
copper fractal
#

Watcha making it for?

slender pewter
#

Horror game important detail

copper fractal
#

i did it

slender pewter
#

Oo

slender pewter
copper fractal
slender pewter
#

@copper fractal

sweet stoneBOT
#

studio** You are now Level 11! **studio

copper fractal
slender pewter
#

Thank you for the help!

copper fractal
#

np can i get sum commision lol

sweet stoneBOT
#

studio** You are now Level 3! **studio

slender pewter
#

[Solved] Fallowing Dummy Head

copper fractal
#

Lemme get $2 💀👀