# Ask for help Animation play

**URL:** <https://phaser.discourse.group/t/ask-for-help-animation-play/4711>\
**Category:** Phaser 3\
**Created:** [December 26, 2019, 1:37pm UTC](https://phaser.discourse.group/t/ask-for-help-animation-play/4711 "2019-12-26T13:37:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yanghao54](https://avatars.discourse-cdn.com/v4/letter/y/e99b99/32.png) [@yanghao54](https://phaser.discourse.group/u/yanghao54)\
**Post date:** [December 26, 2019, 1:37pm UTC](https://phaser.discourse.group/t/ask-for-help-animation-play/4711/1 "2019-12-26T13:37:50Z")

</div>

How does this animation play?

[test|369x500](https://phaser.discourse.group/uploads/short-url/gpZMBElMkTBsO4fStRl7qcLBwK1.png)  
[test.json](https://phaser.discourse.group/uploads/short-url/f88qa0rPFvr8rcBgdHTHrX7xxxA.json) (697 Bytes)

---

<div class="post-metadata">

**Author:** ![Rob](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/rob/32/2515_2.png) [@Rob](https://phaser.discourse.group/u/Rob)\
**Post date:** [December 26, 2019, 2:10pm UTC](https://phaser.discourse.group/t/ask-for-help-animation-play/4711/2 "2019-12-26T14:10:27Z")

</div>

I don’t have time right now to do better than provide some clues.

In preload you’ll do something like:

`this.load.multiatlas("animateMe", `assets/graphics/test.json`, "assets/graphics");`

Before you can use the animation you have to create it, similar to:

` var frameNames = this.game.anims.generateFrameNames('animateMe', { start: 0, end: 7, prefix: 'dongzou_000' });`  
`this.anims.create({key:'dongzou', frames:frameNames, frameRate:10});`

Create a sprite where you want it to display:

`var test = new Sprite(this, 100,100, "animateMe", "dongzou_0000");`

And finally, play the animation:

`test.anims.play('dongzou');`

If that doesn’t work, it’s close. Good luck!

---

<div class="post-metadata">

**Author:** ![Nemesis](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@Nemesis](https://phaser.discourse.group/u/Nemesis)\
**Post date:** [December 26, 2019, 2:20pm UTC](https://phaser.discourse.group/t/ask-for-help-animation-play/4711/3 "2019-12-26T14:20:25Z")

</div>

This Article can help  
[Phaser 3 animations using local JSON File](https://www.foysalahamed.com/blog/learning/phaser-3-animation-using-local-json-file/)

---

<div class="post-metadata">

**Author:** ![yanghao54](https://avatars.discourse-cdn.com/v4/letter/y/e99b99/32.png) [@yanghao54](https://phaser.discourse.group/u/yanghao54)\
**Post date:** [December 26, 2019, 2:48pm UTC](https://phaser.discourse.group/t/ask-for-help-animation-play/4711/4 "2019-12-26T14:48:47Z")

</div>

thank you for your help  
Animation can now be played  
anchor doesn’t seem to work  
 ![GIF](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/7/7eee265fdba9e34c0848b15af0e90a9904269898.gif)
