// Start is called before the first frame update void Start() { layerMask = 1 << 13; filter.SetLayerMask(layerMask); //to catch bugs if (fHP <= 0f) { fHP = 1f; } if (delaySeconds <= 0f) { delaySeconds = 1f; } HealthBarHandler = GetComponent <HealthBarHandler>(); HealthBarHandler.SetMaxHP(fHP); }
int playersToAvoid;// = LayerMask.GetMask("Player"); // Used by Safe aiMvmt. void Start() { layerMask = (1 << 4) | (1 << 9) | (1 << 12); //layersToAvoid.layerMask = 4608;// layersToAvoid.layerMask = LayerMask.GetMask("Obstacles", "Player"); // It may be helpful to put Enemies in seperate layer or get rid of Player layer. playersToAvoid = LayerMask.GetMask("Player"); fWaitTime = fStartWaitTime; frameToCastOn = Random.Range(0, MAX_FRAMES_BETWEEN_RAYCASTS); iRandomSpot = 0; if (aiMvmt == MovementTypeEnum.None) { FillMoveSpots(); aiMvmt = MovementTypeEnum.Patrol; } rb = GetComponent <Rigidbody2D>(); HealthBarHandler = GetComponent <HealthBarHandler>(); HealthBarHandler.SetMaxHP(fHP); feetAnimation = transform.GetChild(2).GetComponent <Animator>(); }