Hello, I’ve been working on making changes to the Top Down example project. I’m looking to set up animation code to simply play any required animation asset rather than using blueprints. The idea is to create dedicated c++ project which why the animation calls are being coded. So far Iv added meshcomponent->PlayAnimation(walking/idle, true) respectively within the move forward function and tick function (when not moving). Doing this however is causing the animation to be stuck on the continuous first frame. So my question is how can I fix this as bools and loops seem to be ineffective for some reason as they are being skipped over by the code when using break points. And is there any method in code to allow easy transition from one animation to another without causing the character to freeze in place.
I have an animation for when the character is idle and for when he’s running. I have a key pressed and the animation starts but the animation is locked to the first frame. So any animation I play just doesn’t work.
I think it is always restarted, thus shows always the 1st frame.
I apply a very simple solution: store the current anim mode (e.g. by an enum variable CurrentAnim = EAnimMode::Idle or Move), and in the character Tick function check whether there is an actual movement or not (movement vector length). If movement is done in the frame, check actual anim state, if EAnimMode::Move, nothing needed, maybe a Play(true);, if EAnimMode::Idle then PlayAmnimation(MoveAsset, true); is required (and of course, need to store new CurrentAnim value). The idle check is similar.