Using MoveDirection for NPCs

Hi! I have been trying to achive a way to use something similar to MoveDirection with NPCs, but I have no clue of what to use to replace it since MoveDirection doesn’t work with NPCs.

I have tried Torso/HumanoidRootPart.Velocity but maybe I am doing something wrong?

I would appreciate the help :smiley:.

An example:

local Torso = script.Parent:WaitForChild("Torso")

while true do
     local Velocity = Torso.Velocity
     -- Rotate
     if Velocity.X > 7 then
          Torso.CFrame = Torso.CFrame * CFrame.angles(math.rad(90), 0, 0) -- Just an example, this would probably not work.
1 Like