Hello Animation

Hello,



I am doing starter tutorial series and I ran into a problem while doing Hello Animation tutorial.

The problem is while doing “Two Animations” task I can’t get animations to work on 2 channels.



Things I added in the code:

public void simpleInitApp()

channel2 = control.createChannel();

channel2.setAnim(“Dodge”);

public void onAnimCycleDone(

if (animName.equals(“Dodge”)) {

channel.setAnim(“stand”, 0.5f);

// channel.setLoopMode(LoopMode.DontLoop);

channel.setSpeed(1f);

}



When “Dodge” is run then “walk” won’t work correctly anymore. Since I use channel2.setAnim(“Dodge”); up there then walk won’t work right away, since it initiates the dodge animation once in the beginning. (The input part of the task is not needed to see this behavior)





It would be nice if there were a sample code for “Two Animations” section.

Can you guys help me with that?



Thank you in advance.

You have to add the single bones you want to be moved by the channel to the channel.

@Normen, can you explain me that in a PM or here, so I can add this info? I don’t think I documented adding subsets of bones in the https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:animation documentation yet, but it should be there.

Look at TestWalkingChar, for shooting it uses the jump animation only with the right arm bones in one channel.