Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by jackrugile

I am using Impact v 1.22. I am interested in getting the name of an entity's currentAnim. When I console.log() on entity.currentAnim, I seem to get most of the information I need, but not the name of the animation.

I want to do this to sync up animations between child entities to parent entities. I have it all working fine when only one animation is being used, because I can utilize the gotoFrame() method. However, gotoFrame() is not enough when I also need to change the named animation to match the parent entity.

Thanks in advance, and let me know if this question needs any clarification.

1 decade ago by pussard

When creating your entity&039;s animations, I would just use the constructor itself instead of #addAnim like so:

(Inside your entity)
this.anims.foo = new ig.Animation(animSheet, 0.1, [0,1,2], true);
// manually add a name property to access later
this.anims.foo.name = 'foo';
Page 1 of 1
« first « previous next › last »