continues to stare in his original direction:
local Dog = script.Parent
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
-- Check if player is moving
local function isPlayerMoving(character)
local humanoid = character:FindFirstChild("Humanoid")
if not humanoid then return false end
return humanoid.MoveDirection.Magnitude > 0.1
end
-- Make dog face player (keeps upright)
local function makeDogFacePlayer(character)
local dogHRP = Dog:FindFirstChild("HumanoidRootPart")
local playerHRP = character:FindFirstChild("HumanoidRootPart")
if dogHRP and playerHRP then
-- Keep same Y level so dog doesn't tilt
local lookPosition = Vector3.new(
playerHRP.Position.X,
dogHRP.Position.Y,
playerHRP.Position.Z
)
local targetCFrame = CFrame.new(dogHRP.Position, lookPosition)
dogHRP.CFrame = dogHRP.CFrame:Lerp(targetCFrame, 0.3)
end
end
RunService.Heartbeat:Connect(function()
local leashAttachment = Dog:FindFirstChild("Leash_Attachment_Dog")
if not leashAttachment then return end
local rope = leashAttachment:FindFirstChild("RopeConstraint")
if not rope or not rope.Attachment1 then return end
local playerHRP = rope.Attachment1.Parent
if not playerHRP or playerHRP.Name ~= "HumanoidRootPart" then return end
local character = playerHRP.Parent
local player = Players:GetPlayerFromCharacter(character)
if not player then return end
local currentlyMoving = isPlayerMoving(character)
-- If player is NOT moving, keep facing them
if not currentlyMoving then
makeDogFacePlayer(character)
end
end)