# Custom class animations not working

**URL:** <https://phaser.discourse.group/t/custom-class-animations-not-working/10563>\
**Category:** Phaser 3\
**Created:** [October 31, 2021, 8:58pm UTC](https://phaser.discourse.group/t/custom-class-animations-not-working/10563 "2021-10-31T20:58:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Disuqi](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/disuqi/32/5794_2.png) [@Disuqi](https://phaser.discourse.group/u/Disuqi)\
**Post date:** [October 31, 2021, 8:58pm UTC](https://phaser.discourse.group/t/custom-class-animations-not-working/10563/1 "2021-10-31T20:58:43Z")

</div>

I don’t understand what’s wrong with my code, I looked it up online, I tried messing around but I couldn’t get it to work. [GitHub - Disuqi/Disuqi.github.io](https://github.com/Disuqi/Disuqi.github.io) here you can see all the source code  
PLEASE HELP I have been stuck for hours it’s really frustrating ☹

---

<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 31, 2021, 9:03pm UTC](https://phaser.discourse.group/t/custom-class-animations-not-working/10563/2 "2021-10-31T21:03:50Z")

</div>

👋

Which part isn’t working and how?

---

<div class="post-metadata">

**Author:** ![Disuqi](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/disuqi/32/5794_2.png) [@Disuqi](https://phaser.discourse.group/u/Disuqi)\
**Post date:** [October 31, 2021, 10:58pm UTC](https://phaser.discourse.group/t/custom-class-animations-not-working/10563/3 "2021-10-31T22:58:32Z")

</div>

if you go to the github page and look at the playerClass branch, you can see that I tried to make a custom class called player, before that I just had this.physics.add.sprite(x, y, key); where this was the main scene. I then changed this to be new Player(scene, x, y); Player is the custom class that extends Phaser.Physics.Sprite I think or something similar. Anyways when I did that the animations did not work any more. I can see the debug lines, I think that’s what they are called and I can move the player, but no animation will play, not even idle, nothing. I tried setting the frame of the player to 0, but that did not work as well. I am not sure what’s wrong. I really appreciate your help. Thank you very much

---

<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:** [November 1, 2021, 12:18am UTC](https://phaser.discourse.group/t/custom-class-animations-not-working/10563/4 "2021-11-01T00:18:49Z")

</div>

> <https://github.com/samme/Disuqi.github.io/commit/4a19a61895f13d14ed456ee64d6deb5cf6380ac7>

[https://github.com/samme/phaser3-faq/wiki#how-do-i-extend-a-game-object](https://github.com/samme/phaser3-faq/wiki#how-do-i-extend-a-game-object)

---

<div class="post-metadata">

**Author:** ![Disuqi](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/disuqi/32/5794_2.png) [@Disuqi](https://phaser.discourse.group/u/Disuqi)\
**Post date:** [November 1, 2021, 9:22am UTC](https://phaser.discourse.group/t/custom-class-animations-not-working/10563/5 "2021-11-01T09:22:10Z")

</div>

That worked thank you so much!
