How do you make a Humanoid (or an enemy) go to another humanoid that is not a player (a robloxian)?
✓ ANSWER ACCEPTED
How do you make a Humanoid go to another humanoid that is not a player?
1 answer
✓ Accepted answer
You could use something called WalkToPart or WalkToPoint. WalkToPart is an object value so make the WalkToPart the enemy's torso or something like this:
game.Workspace.Player1.Humanoid.WalkToPart = game.Workspace.Enemy.Torso
The character will walk to the enemy.
This would also work. This uses WalkToPoint which is a Vector3 value.
game.Workspace.Player1.Humanoid.WalkToPoint = game.Workspace.Enemy.Torso.Position
I hoped this helped! Below is some EXTRA STUFF YOU MIGHT WANT TO KNOW!
With this feature has some drawbacks. If it's a player then they can just WALKAWAY! What you might want to do is make a loop that loops until the humanoid has reached it's destination.
while wait() do
game.Workspace.Player1.Humanoid.WalkToPoint = game.Workspace.Enemy.Torso.Position
end
--or
while wait() do
game.Workspace.Player1.Humanoid.WalkToPoint = game.Workspace.Enemy.Torso.Position
end
Note this will make the player go on forever and when the enemy dies or dissapears, then the script will error so work this out.
This discussion is preserved as it was. New answers, comments, and votes are closed.
