how set an animation frame?

0 favourites
  • 2 posts
From the Asset Store
three fully animated characters ideal for your RPG side scroller projects
  • i have a fiew shirts of card in one sprite,each as frame.

    an animation speed for this sprite set 0,so i can place some exemplars of sprite on layer in editor,and set the frame-and i will have different shirts,it's ok.

    but when i place sprite on script,and try set a frame-it' no luck,just see the first frame.

     for (var a=1;a<=cards_for_each;a++)
     {
     runtime.objects["Card_shirt"].createInstance("Layer 10",opp_one_start_pos_x+(a*15),opp_one_start_pos_y);
     }
     runtime.objects["Card_shirt"].getAllInstances().animationFrame=1;
    

    despite on different indexes-i see an 0 frame.i was think that i must start animation for change frame on layer,so add below this row

    runtime.objects["Card_shirt"].getAllInstances().startAnimation("current-frame");

    and get error

    runtime.objects.Card_shirt.getAllInstances(...).startAnimation is not a function

    where is the mistake?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • runtime.objects.["Card_shirt"].getFirstInstance().animationFrame = 0;

    runtime.objects.SPRITE_NAME.getFirstInstance().animationFrame = 0;

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)