Example #1
0
 public void FixedUpdate()
 {
     playerFound = character.SeesPlayer();
     if (stepTime <= 0f)
     {
         character.MoveCharacter(horizontalMovement);
         stepTime = TIME_BETWEEN_STEPS;
         stepsTaken++;
     }
 }
Example #2
0
    public void FixedUpdate()
    {
        // character.MoveCharacter(horizontalMovement);
        if (stepTime <= 0f)
        {
            character.MoveCharacter(horizontalMovement);
            stepTime = TIME_BETWEEN_STEPS;
        }

        playerIsInSight = character.SeesPlayer();

        if (playerIsInSight)
        {
            playerIsInAttackRange = character.PlayerInAttackRange(character.basicAttack.transform.localPosition.x); // 2f comes from scaleY from hitbox's transform component
        }
    }