I’m working with animations and got confused how exactly should I work with channels.
Here’s my code:
[java]AnimChannel channel = animCtrl.getChannel(0);
if (up || down || right || left) {
if (channel.getAnimationName() == null) {
channel.setAnim(“walk”, 1f);
channel.setLoopMode(LoopMode.Loop);
}
} else if (isSpeed && up || down || right || left) {
if (channel.getAnimationName() == null) {
channel.setAnim("run", 1f);
channel.setLoopMode(LoopMode.Loop);
}
} else {
channel.reset(true);
}[/java]
Walking works fine but when I hold SHIFT for speed I wanna get running animation, not walk, so I have to create other channel for running?