// Update is called once per frame protected virtual void FixedUpdate() { rbody.AddForce(new Vector2(Random.Range(-1f, 1f), Random.Range(-1f, 1f))); timePassed += Time.deltaTime; if (timePassed > timeToCheck) { if (LightSource.InBrightLight(enemy.transform.position)) { enemies.Remove(enemy); Destroy(enemy); return; } timePassed = 0; } }