how to play animation on added tile sprite game object
dude = this.add.tileSprite(100, 450, 100,100, 'dude');
player=this.physics.add.existing(dude, false);
player.body.setBounce(0.3);
player.body.setCollideWorldBounds(true);
Animation
this.anims.create({
key: 'left',
frames: this.anims.generateFrameNumbers('dude', { start: 0, end: 3 }),
frameRate: 10,
repeat: -1
});
and playing it with the anims.play return dude.anims or player.anims is undefined
player.anims.play('left', true);
or
player.body.anims.play('left', true);
or
dude.anims.play('left', true);
the animation will play if I add the sprite by
player = this.physics.add.sprite(x,y,sprite)