Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a humanoid always stay in front of me?

When I use MoveTo, it doesn't let me use CFrame, so I can't make the humanoid character always in front of me. Here is my script:

chr = script.Parent
humanoid = workspace.Noob

while wait() do
humanoid:MoveTo(chr.Torso.Position + Vector3.new(0,0,5)) -- my compromise
end

1 answer

✓ Accepted answer

You can get the position of a CFrame by doing CFrame.p

local chr = script.Parent
local humanoid = workspace:WaitForChild("Noob")

while wait() do
	humanoid:MoveTo((chr.Torso.CFrame * CFrame.new(0,0,-10)).p) 
end

If you're confused why I think this should work, here's a link that helped me find my answer.

1 comment

0

thank you i appreciate it

This discussion is preserved as it was. New answers, comments, and votes are closed.