How to let a NPC move forward

There are much Topics how you can let a NPC walk to a part or move forward.

But how can I let a NPC walk forward with the max speed, like when a player presses W or S?

Thank you

Humanoid:MoveTo

1 Like

As I said

How can I let him walk like when the player presses W or S?

3 Likes

You can use Humanoid:Move()

You pass in a direction and it moves in that direction.
Example:

local root = script.Parent.HumanoidRootPart
local humanoid = script.Parent.Humanoid

humanoid:Move(root.CFrame.lookVector * 10) -- should make the humanoid move forwards
6 Likes

Thank you, this works, but without animation.

It work but not when I want to give the NPC a ā€œDā€ I put or a ā€œaā€ input.

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