- Home /
Other
How do I get a script to make a character or object follow your player?
This script that I am talking about is a script where you add too a certain object/player and they automatically follow the target you requested them to follow.
Simples way is to just use http://docs.unity3d.com/Documentation/ScriptReference/Transform.LookAt.html and have the NPC move towards that point it's looking at, but that doesn't take into account any obstacles, so there's lots of room for failure. Of course it be prettier if you would check how far the player is from the NPC, if there are any obstacles, etc. and handle all that so that the NPC doesn't get stuck.. or perhaps you can use a nav$$anonymous$$esh... which I never done before so, I can't comment on that.. :|
This is a website where you get answers to specific technical questions. Not where you ask for scripts
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
How do i make zombies? 2 Answers
How can I get this script to work? 1 Answer
Problems with java script. 1 Answer
Script to make an enemy follow the player when they trigger a door? 0 Answers