I have to ask you guys after some attempts. My small game is about 3rd person view. In game, I use mouse to relocation my character and do running animation (Sinbad model). Attached is a brief description for the problem I have with all approaches I know so far.
I have CharacterState and CharacterControl. In CharacterState, I use ActionListener to get new location of character from 1 mouse click then pass this parameter to CharacterControl to create nomalized vector from current and new location, the controlUpdate will keep translate my character into new locations base on normalized vector until it reach the last one. Everything is working fine.
The point is I want to do run animation during the moving. This should be easy if I keep pressing a button and do channel.setAni(“run”). But I just want to use 1 click and both moving and running with animation automatically. As what I have tried is I put the animation in update loop like translation but its freeze because the program repeat the animation fast and no animation is completed. Then I have tried to put animation on actionListenner, however I use only 1 click, the animation works unstoppable. I have to click again to stop it or change to another animation.
Hope you guys can help me.