NPC walking animation doesnt work with pathfinding

Hi, so I am making an NPC that shoots people, but when the NPC walks, it doesnt play the normal roblox walking animation. Maybe it is because I am playing other animations, so it might override the roblox walking animation?

Im not sure, if anyone has a solution, let me know!

local function WalkTarget(target)
	print('Walking towards target')
	local path = game:GetService("PathfindingService"):CreatePath()

	path:ComputeAsync(Btorso.Position, target.Position)


	local waypoints = path:GetWaypoints()

	for i, waypoint in pairs(waypoints) do
		
		if waypoint.Action == Enum.PathWaypointAction.Jump then
			Bhumanoid.Jump = true
		end
		
		Bhumanoid:MoveTo(waypoint.Position)
	end
end
1 Like

Does your NPC have an Animate script (like the one your character has?)

Hi, sorry for the late reply. No, there is no Animate script in the rig. How can I add the Animate script?

You need to copy the Animate script from your own Character.

Here is a video that explains the details:

Jump ahead to time 4:30

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.