I want the R15 NPC to walk straight down the aisle with an animated walk. Therefore, I need to set the WalkSpeed lower to match the animation. When the speed is set to anything under 9, it does not reach the destination. The slower the speed is, the less distance it travels.
local animationId = "rbxassetid://18333836373"
local npc = script.Parent
local humanoid = npc:WaitForChild("Humanoid")
humanoid.WalkSpeed = 9
local animation = Instance.new("Animation")
animation.AnimationId = animationId
local animationTrack = humanoid:LoadAnimation(animation)
animationTrack:Play()
wait(10)
local designatedPart = game.Workspace.SpawnLocation
local function moveToDesignatedPart()
local targetPosition = designatedPart.Position
humanoid:MoveTo(targetPosition)
humanoid.MoveToFinished:Connect(function(reached)
if reached then
print("NPC reached")
end
end)
end
animationTrack:Play()
moveToDesignatedPart()