Hello,
I wanna do attack animations while clicking LPM. Here are codes:
[java] public void setUpKeys() {
inputManager.addMapping(“Hit”, new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
inputManager.addListener(this, “Hit”);
}
public void onAction(String binding, boolean isPressed, float tpf) {
} else if (binding.equals(“Hit”)) {
hit = isPressed;
currentAnim = getRandomAnim();
}
} else if (hit) {
if (channel.getAnimationName() == null) {
channel.setAnim(currentAnim);
channel.setLoopMode(LoopMode.DontLoop);
}
} else {
channel.reset(true);
}
[/java]
but in game I MUST Hold LPM to run animation to the end. Also when it’s done it doesn’t back to my stand animation. What I have to do to just simple click once LPM, animation is executing until it’s finished and player back to stand/reset animation?