I see this asked a lot here but never fully answered. I’ve asked similar questions before. Here are the ground rules:
- NO use of animation blueprints
- NO use of animation state machines
- ONLY C++ calls to play, blend, and manage animation assets
We have:
Montage_Play(anim, play speed), and Montage_JumpToSection to skip ahead.
I can’t see a way to blend 2 (or more) animation together from C++; alternatively, a way to play a Blend Space (1D or 2D) from C++.
I can’t see a way to play an animation into a particular slot from C++ (eg, Upper body or Lower body). Playing a Montage that is not set to slot “Full Body” or “Default” results in not playing at all.
I can’t see a way to play an animation to the end and stopping there (i.e. not looping the animation). I could add a bunch of logic to do manage this, but animation systems normally have this in there somewhere.
If it’s not possible, I’m fine with that as an answer. If you’re curious about why I would not want to use the editor features for these things you can read the following but if you’re not curious then you can skip the rest of this paragraph. I’ve been developing games for many years now and am very comfortable with C++ implementations. IMO, the animation part of the editor is bad for game development. Having two competing and unrelated state machines (one for behavior and one for animation) battling for control over a character is an ill-conceived concept. Both developing complexity in their own unique ways (state machine vs behavior tree or other) while trying to keep it in sync and tracking lines of causality is crazy house. Bugs are invisible, systematic and display emerging behavior (the perfect storm of development pain). It’s fine if you’re a student trying to learn 3D but for complex professional work, specially dealing with complex animations, it’s a non-starter.