# Can't seem to call use this.effect() or alternative

**URL:** <https://forums.moddingtree.com/t/cant-seem-to-call-use-this-effect-or-alternative/1426>\
**Category:** Modding Developers\
**Created:** [April 11, 2024, 12:35am UTC](https://forums.moddingtree.com/t/cant-seem-to-call-use-this-effect-or-alternative/1426 "2024-04-11T00:35:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BanaCubed](https://forums.moddingtree.com/user_avatar/forums.moddingtree.com/banacubed/32/969_2.png) [@BanaCubed](https://forums.moddingtree.com/u/BanaCubed)\
**Post date:** [April 11, 2024, 12:35am UTC](https://forums.moddingtree.com/t/cant-seem-to-call-use-this-effect-or-alternative/1426/1 "2024-04-11T00:35:50Z")

</div>

For some reason when I try to call `this.effect()`, it causes error:  
`Uncaught TypeError: this.effect is not a function`

Trying to use `layers.C.effect()` causes error:  
`Uncaught TypeError: Cannot read properties of undefined (reading 'effect')`

And I know this isn’t how `effect()` is used, but using `player.C.effect()` causes error:  
`Uncaught TypeError: Cannot read properties of undefined (reading 'C')`

The entire layer is:

```auto
addLayer('C', {
    name: "hyper-cash",
    resource: "Hyper Cash",
    startData() {
        return {
            unlocked: true,
            points: new Decimal(0)
        }
    },
    update(diff) {
        if(hasMilestone('HC', 0)) player.C.points = player.C.points.add(new Decimal(0.1).times(diff))
    },
    effect() {
        return player.C.points.times(0.01).add(1)
    },
    effectDescription: "placeholder " + format(this.effect()),
    color: "#34eb67"
})

```

(I’m using layer proxy to render the layer)

`layers.C.effect()` works perfectly fine in `mod.js` when implementing the effect (doesn’t seem to work in other layers)

---

<div class="post-metadata">

**Author:** ![BanaCubed](https://forums.moddingtree.com/user_avatar/forums.moddingtree.com/banacubed/32/969_2.png) [@BanaCubed](https://forums.moddingtree.com/u/BanaCubed)\
**Post date:** [April 11, 2024, 5:33am UTC](https://forums.moddingtree.com/t/cant-seem-to-call-use-this-effect-or-alternative/1426/2 "2024-04-11T05:33:45Z")

</div>

I changed it so that effectDecription is a function and it works now
