#The npc is not rotating when following me.

1 messages · Page 1 of 1 (latest)

gray arch
#

local function followLeaderLoop(player, npc)
local humanoid = npc:FindFirstChildOfClass("Humanoid")
if not humanoid or not npc.PrimaryPart then return end

humanoid.AutoRotate = true -- Ensures NPC auto-rotates towards movement direction

while player and player.Character and player.Character.PrimaryPart and
    followConnections[player.UserId] and followConnections[player.UserId][npc] do

    local playerPos = player.Character.PrimaryPart.Position
    local npcPos = npc.PrimaryPart.Position
    local distance = (playerPos - npcPos).Magnitude

    if distance > 6 then
        
       
        
        humanoid:MoveTo(playerPos)
    else
        humanoid:MoveTo(npcPos) -- Stay in place if close enough
    end

    task.wait(0.25) 
end

end

ocean oriole
#

does your npc have a bodygyro, or any bodymover inside it?