Question by
Yeilo96 · Aug 11, 2016 at 09:24 PM ·
aitagspawningfollow player
How i make the AI follow player by tag
I need a Simple IA to follow my player using nav mesh... But the IA must to respawn and start follow the Player. i Don't know how to do it whit out a public transform. I was usign this script but y can't create/spawn the Enemy IA because the public transform where must to be te player is empty.... Please helppp
Comment
Best Answer
Answer by flatalex123 · Aug 12, 2016 at 09:12 AM
place this on the enemy public Transform goal = playerName.position;;
void Update() {
NavMeshAgent agent = GetComponent<NavMeshAgent>();
agent.destination = goal.position;
}