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

How would I make an NPC copy, the players movement?

What am trying to make is a clone of the player, and that clone would copy the players movement. For example of the Player goes Left the Clone would also go Left, but i dont want the clone to be too close. Or I would like the clone to do the opposite direction. If player goes left, the clone would go right, but if player walks forward the clone would also walk forward, same goes for backward. I just need an idea on how to start doing that. Ive tried for about 4 hours with no luck.

I cant do something like

CloneHumanoid.MoveDirection = PlayerHumanoid.MoveDirection

1 answer

Im not certain that this will work but maybe try this:

playerHumanoid.Running:Connect(function()
	local pos = playerCharacter.HumanoidRootPart.Position
	
	pos = Vector3.new(pos.X - 5, pos.Y, pos.Z - 5)
	
	CloneHumanoid:MoveTo(pos)
end)

2 comments

0

Yeah, but the problem with that, The NPC just follows you. I am trying to make the NPC only follows your movement. Not go where you are then follow it xD

0

i think its got to do something with humanoid.MoveDirection

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