Making an npc move forwards

I’m trying to make an npc move in the direction he looks, but he just moves in the same direction

robloxapp-20230609-2343253.wmv (942.9 KB)

heres what i have:

local hum = script.Parent.Parent.Parent.Humanoid
local head = script.Parent.Parent.Parent.HumanoidRootPart

script.Parent.MouseClick:Connect(function()
	hum:Move(Vector3.new(head.Orientation.X-1,head.Orientation.Y,head.Orientation.Z), false)
end)

ive tried to make it directly forward but he just turns
robloxapp-20230609-2349264.wmv (1.4 MB)

this what its written as:

local hum = script.Parent.Parent.Parent.Humanoid
local head = script.Parent.Parent.Parent.HumanoidRootPart

script.Parent.MouseClick:Connect(function()
	hum:Move(Vector3.new(head.Orientation.X,head.Orientation.Y,head.Orientation.Z), false)
end)
2 Likes

Look into the CFrame of the ‘head’ and try to use its .LookVector for the Vector3 to move to.

3 Likes

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