So I’m making a project where a NPC named Enemy is supposed to constantly follow the player, this works and the enemy is pointing at the player, but laying on its side.
Code:
<code>public Transform Target; //player
public NavMeshAgent agent; //enemy
void Update()
{
agent.SetDestination(target.position);
}
</code>
<code>public Transform Target; //player
public NavMeshAgent agent; //enemy
void Update()
{
agent.SetDestination(target.position);
}
</code>
public Transform Target; //player
public NavMeshAgent agent; //enemy
void Update()
{
agent.SetDestination(target.position);
}
Any fixes?
I look at multiple answers on this sight, but none of them worked.
New contributor
Cameron McLaughlin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.