2 Replies Latest reply on Sep 26, 2015 3:22 PM by Colin Holgate

    How to animate a character with multiple clothes

    ozand27105008

      Hi,

      Think about rpg games. Mostly main character's outer look changes when he wears a different cloth. So there is these movieclips called:

      1-character

      2-cloth

       

      Character consists of different animations like running, walking, jumping etc.

      And cloth consists of different clothes.

       

      Normally if hero doesn't move it's easy like

       

      Hero.gotoAndStop(x);

      Hero.Cloth.gotoAndStop(x);

       

      Problem is, this cloth must move according to character's current stance. So there is different drawings for each cloth. When character is at frame "x", cloth must be at frame "x" as well.

      Then this movieclip named cloth consists of another movieclips like "blue cloth" , "red cloth" etc. and each of this blue cloth and red cloth has different frames for character's different stances.

       

      How can I initialize this hero with it's current cloth and how can I change it's cloth's current frame in as3 ?

       

       

      I really hope I could describe my problem.

       

      Best regards

      -Ozan

        • 1. Re: How to animate a character with multiple clothes
          kglad Adobe Community Professional & MVP

          the frames of redcloth should align with the frames of hero.  when you want to change hero from wearing bluecloth to ear redcloth, use;

           

          hero.removeChild(bluecloth);

          hero.addChild(redcloth);

          recloth.gotoAndStop(hero.currentFrame);  // <- and whenever hero changes frames, execute this line.

           

          to change cloths, do the obvious.

          1 person found this helpful
          • 2. Re: How to animate a character with multiple clothes
            Colin Holgate MVP & Adobe Community Professional

            What kglad says is more if you are doing everything with code.

             

            For your original question, within cloth you could have a movieclip containing other movieclips for each stance animation. Your setup would be:

             

            hero.gotoAndStop(x);

            hero.cloth.gotoAndStop(x);

            hero.cloth.stances.gotoAndStop(number based on which stance you are at right now);

            1 person found this helpful