Yes I know a similar question has been asked before but it was explained so poorly that I’m forced to ask the question again. Here is the function that is called when the enemy is chasing the player.
void ChasePlayer()
{
one = false; //Ignore this
two = false; //Ignore this
enemySpeed = 3; //Speed is increased from walking to running
transform.LookAt (Player.position); //Enemy faces the player
transform.position = Vector3.MoveTowards(transform.position, Player.position, enemySpeed * Time.deltaTime); // the enemy's position is equal to moving from it's current position to player position at running speed.
}
Problem is that if the player jumps the enemy starts flying, how would I limit him from looking up at the player. Would it need to track something that isn’t jumping? An empty that the player is parented to maybe. Or is there some way of doing it in script?