# Why isn't this layer unlocking?

**URL:** <https://forums.moddingtree.com/t/why-isnt-this-layer-unlocking/487>\
**Category:** Modding Developers\
**Created:** [February 19, 2022, 4:05pm UTC](https://forums.moddingtree.com/t/why-isnt-this-layer-unlocking/487 "2022-02-19T16:05:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![unp\_gged](https://forums.moddingtree.com/user_avatar/forums.moddingtree.com/unp_gged/32/321_2.png) [@unp\_gged](https://forums.moddingtree.com/u/unp_gged)\
**Post date:** [February 19, 2022, 4:05pm UTC](https://forums.moddingtree.com/t/why-isnt-this-layer-unlocking/487/1 "2022-02-19T16:05:27Z")

</div>

So, I was planning to make some sort of meta-layer that would reset most things in the normal tree when you reset it, and I wanted it to be based off of how many upgrades you had. I wanted it to unlock when I had 10 upgrades. However, for some reason, after 12 upgrades it still isn’t unlocked.  
Can somebody help me with this issue? Are there any bugs in the code that I should be aware of? Am I missing any code?

```auto
addLayer("p", {
  name: "prestige",
  symbol: "P",
  startData() { return {
    unlocked: false,
    points: new Decimal(0),
    total: new Decimal(0),
    best: new Decimal(0),
    resetTime: new Decimal(0),
  }},
  color: "#F7A",
  requires: new Decimal(10),
  resource: "prestige points",
  baseResource: "upgrades",
  baseAmount() {return new Decimal(player.f.upgrades.length)},
  hotkeys: [{key: "p", description: "P: Prestige, if possible", onPress(){if(canReset(this.layer)) doReset(this.layer)}},],
  layerShown(){return new Decimal(player.f.upgrades.length).gte(5) || player[this.layer].total.gte(1)},
  resetDescription: "Reset the normal tree and your size to get ",
  row: "side",
}),

```

---

<div class="post-metadata">

**Author:** ![thepaperpilot](https://forums.moddingtree.com/user_avatar/forums.moddingtree.com/thepaperpilot/32/74_2.png) [@thepaperpilot](https://forums.moddingtree.com/u/thepaperpilot)\
**Post date:** [February 19, 2022, 4:13pm UTC](https://forums.moddingtree.com/t/why-isnt-this-layer-unlocking/487/2 "2022-02-19T16:13:57Z")

</div>

What happens if you run `player.f.upgrades.length` in console?

---

<div class="post-metadata">

**Author:** ![unp\_gged](https://forums.moddingtree.com/user_avatar/forums.moddingtree.com/unp_gged/32/321_2.png) [@unp\_gged](https://forums.moddingtree.com/u/unp_gged)\
**Post date:** [February 19, 2022, 8:48pm UTC](https://forums.moddingtree.com/t/why-isnt-this-layer-unlocking/487/3 "2022-02-19T20:48:19Z")

</div>

Unfortunately, I only have access to my school’s computer (and a phone) right now, which means most developer features (specifically the console) are blocked. Are there any alternative ways to access the console / check without the console?

---

<div class="post-metadata">

**Author:** ![thepaperpilot](https://forums.moddingtree.com/user_avatar/forums.moddingtree.com/thepaperpilot/32/74_2.png) [@thepaperpilot](https://forums.moddingtree.com/u/thepaperpilot)\
**Post date:** [February 19, 2022, 11:57pm UTC](https://forums.moddingtree.com/t/why-isnt-this-layer-unlocking/487/4 "2022-02-19T23:57:45Z")

</div>

If you can edit the code, you could have it display the value in some tabFormat somewhere, or in the thingsToDisplay array

---

<div class="post-metadata">

**Author:** ![thepaperpilot](https://forums.moddingtree.com/user_avatar/forums.moddingtree.com/thepaperpilot/32/74_2.png) [@thepaperpilot](https://forums.moddingtree.com/u/thepaperpilot)\
**Post date:** [April 1, 2023, 7:42pm UTC](https://forums.moddingtree.com/t/why-isnt-this-layer-unlocking/487/5 "2023-04-01T19:42:10Z")

</div>

Split this topic on April 1, 2023, 7:42pm UTC

A post was split to a new topic: [My layer isn’t appearing](https://forums.moddingtree.com/t/my-layer-isnt-appearing/988)
