Is there a way to access custom animation curves data of an arbitrary animation sequence without actually playing it yet?

MartenZander
Mon, 08 Jan 2024 09:47:46 +0000
Character & Animation

Hey there,
most recently I’ve been working on a good looking solution to make a ground moving and flying creature seamlessly transition from one movement mode to the other. For the transition from walking to flying I have a “take off” animation montage. This montage uses root motion for best visual results and it works great. However, for the landing animation I kind of need to know the approximate height before I trigger the landing animation. That is because my pawn is AI Controlled and To initiate the landing I want to steer the pawn into a suitable distance from the ground before executing the landing animation with a bit of motion warping.

That being said, my issue here is, how do I know the suitable height for the landing animation? Well, I know that my landing animation will look good when being triggered with a distance from 5m to the ground. However, I only know that because I was the one who animated the landing sequence. Instead of hard coding these values into my logic, I’d rather have something more dynamic. My initial idea was to create distance curves in my landing animations (yes there will be more then one) that will basically tell me from which height the animation should be played. But unfortunately to my disappointment there is no way to access custom curves in animation sequences before that particular sequence is actually playing.

Let me try to explain this a bit further. usually you can read custom curve values with the “Get Curve Value” node. But the problem is, this node only works and iterates over all the animation sequences that are currently relevant to the skeletal meshes output pose. What I really need though is information abotu custom curves before I start playing a certain animation.

For example I want to choose one of my many landing animations randomly. Then I want to read the initial distance curve value to learn about the suitable height for that animation. Next I would move my pawn to that height and after that play the pending landing animation.

So to sum it up and put it all into a simplified question: “Is there a way to access custom animation curves data of an arbitrary animation sequence without actually playing it yet?”

4 posts - 2 participants