# How do I use 'this' in Phaser3?

**URL:** <https://phaser.discourse.group/t/how-do-i-use-this-in-phaser3/12021>\
**Category:** Phaser 3\
**Created:** [July 15, 2022, 5:37pm UTC](https://phaser.discourse.group/t/how-do-i-use-this-in-phaser3/12021 "2022-07-15T17:37:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ei9997](https://avatars.discourse-cdn.com/v4/letter/e/90ced4/32.png) [@ei9997](https://phaser.discourse.group/u/ei9997)\
**Post date:** [July 15, 2022, 5:37pm UTC](https://phaser.discourse.group/t/how-do-i-use-this-in-phaser3/12021/1 "2022-07-15T17:37:42Z")

</div>

I’m new to Phaser and I’m struggling to understand how ‘this’ is supposed to be used when calling a function I’ve made myself. I’ve tried making it a parameter of the function `shiftPlayer` but I still get an error saying that add is not a function. My functions are not in a classes.

```javascript
function movePlayer(player, diceNumber)
{
    //....
    shiftPlayer(player, point[0] - 30, point[1] - 25);
}
function shiftPlayer(player, x, y)
{
    return thisSelf.tweens.add({
        //....
    })
}

```

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [July 15, 2022, 5:45pm UTC](https://phaser.discourse.group/t/how-do-i-use-this-in-phaser3/12021/2 "2022-07-15T17:45:49Z")

</div>

👋

You can use [call()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call) to control calling context.

```javascript
function update () {
  movePlayer.call(this, player, diceNumber);
}

```
