# TypeError: Cannot read properties of undefined (reading 'texture')

**URL:** <https://phaser.discourse.group/t/typeerror-cannot-read-properties-of-undefined-reading-texture/10395>\
**Category:** Phaser 3\
**Created:** [October 10, 2021, 5:06pm UTC](https://phaser.discourse.group/t/typeerror-cannot-read-properties-of-undefined-reading-texture/10395 "2021-10-10T17:06:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MosqueBurger](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/mosqueburger/32/5701_2.png) [@MosqueBurger](https://phaser.discourse.group/u/MosqueBurger)\
**Post date:** [October 10, 2021, 5:06pm UTC](https://phaser.discourse.group/t/typeerror-cannot-read-properties-of-undefined-reading-texture/10395/1 "2021-10-10T17:06:49Z")

</div>

```javascript
 preload() {
        // prelaoding atlas png and json and anim json
        this.load.atlas('character','./Assets/Sprites/character_atlas.png','./Assets/Sprites/character_atlas.json');
        this.load.animation('character_anims','./Assets/Sprites/character_anim.json');
    }

    create(){
        // assigning player object to a physic
        this.player = new Phaser.Physics.Matter.Sprite(this.matter.world,0,0,'character','male_9');
        // printing sprite onto screen
        this.add.existing(this.player);
        // assigning keyboard inputs to variables
        this.inputKeys = this.input.keyboard.addKeys({
            up: Phaser.Input.Keyboard.KeyCodes.UP,
            down: Phaser.Input.Keyboard.KeyCodes.DOWN,
            left: Phaser.Input.Keyboard.KeyCodes.LEFT,
            right: Phaser.Input.Keyboard.KeyCodes.RIGHT,
        })
        console.log(this.player.anims);
    }

    update(){
        this.player.anims.play('walking_right')

```

Hello everyone! I am new to Phaser and Coding in general, why is there an undefined ‘texture’ for my Physics.Matter.Sprite object when I passed in ‘character’ as the parameter for the texure.

---

<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:** [October 10, 2021, 5:14pm UTC](https://phaser.discourse.group/t/typeerror-cannot-read-properties-of-undefined-reading-texture/10395/2 "2021-10-10T17:14:20Z")

</div>

👋

> [@MosqueBurger](#):
>
> `this.player.anims.play('walking_right')`

Remove this for now and see if it fixed the problem.

Add to `create()`:

```js
console.log('anims', this.anims.anims.entries);

```

and check console.

---

<div class="post-metadata">

**Author:** ![MosqueBurger](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/mosqueburger/32/5701_2.png) [@MosqueBurger](https://phaser.discourse.group/u/MosqueBurger)\
**Post date:** [October 14, 2021, 10:02am UTC](https://phaser.discourse.group/t/typeerror-cannot-read-properties-of-undefined-reading-texture/10395/3 "2021-10-14T10:02:28Z")

</div>

sorry for the late reply, fixed the problem, I was using a wrong key to link my atlas to my animations!
