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

Help With Following?

script.Parent.Zombie:MoveTo(v.Character.Torso.Position - Vector3.new(10,0,10) - v.Character.Torso.CFrame.lookVector)

This is a script meant to have the zombie constantly stay 10 studs behind the player, but rather than that it just keep it positive 10 studs away. I thought that throwing the Character's Torso's lookVector in there and having it keep behind the look vector would work but that doesn't help. Can someone help me keep the zombie behind the player's back at all times?

1 answer

✓ Accepted answer
v.Character.Torso.Position - Vector3.new(10,0,10) - v.Character.Torso.CFrame.lookVector

is going to do the following:

  1. get the player's position

  2. move over 10 in the x and z directions globally

  3. move over 1 stud in the direction of the player

to fix, instead of that second step, just make the third step more pronounced by multiplying the lookVector by ten:

script.Parent.Zombie:MoveTo(v.Character.Torso.Position - 10*v.Character.Torso.CFrame.lookVector)

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