When defining a custom Notify State, it would be REALLY handy if there was a way to call the value of a named Curve on the anim at the current animation time.
For example, I’ve got these generic notifies for handling player movement due to airborne melee attacks. Suppose I want an attack to lerp between forward momentum and midair suspension, using a curve to define the rate of transition. I could place the Notify State, and then use a named vector curve (i.e. floattrajectory) to sculpt the player’s velocity every Tick.
However, even though Notify States CAN do this (since the AnimTrail state does so), there doesn’t seem to be an exposed way to create this behavior in the Notify Blueprint editor.
I’ve tried to access this yesterday in a UMG Widget (I wanted to add a bit of HUD shaking while walking and thought it might be a good idea to tie that to the animations). It has the “BlueprintProtected = true” metadata so it’s only available in the Animation Blueprint.
It’s a public function in C++. So for now you can write a bit of code to expose it to whatever class you want it for, if it’s really needed.
It never occurred to me that I would need to call the AnimInstance to get the curve value. I’ve called curve values on AnimBPs before (just directly) but it wasn’t appearing in the context menu for Ticks, so I didn’t realize it would work.
And this calls the value at that point in the anim? Cool.
Welp, off to implement some stuff, thanks guys!
EDIT: Can’t do it, this node doesn’t exist in 4.7.2
There is no such node as “Get Curve Value”. It simply does not appear, even with Context Sensitive unchecked. The only nodes are “Get Float Value”, “Get Vector Value”, etc… and these require a curve asset as a Target which I cannot get. There is no way for me to access the Get Curve Value node you’re showing.
One polite bump to see if Exelcior can explain how he got that node to appear.
I even tried to copy-paste from another BP and discovered that I cannot access curve values from ANY AnimInstance node, the Get Curve Value node only appears in AnimBPs and it refuses to allow itself to be copy-pasted.
I really need this functionality for designing aerial motion curves, and obviously someone somewhere has a version of the editor where it can be done. Kind of at a loss here.
Sorry I haven’t replied, must have scanned over the thread and not realised; apologies!
Unfortunately that node has changed very recently. I’m working in our Main/Master branch and didn’t check that before I suggested it to you. This will work in upcoming updates but if you want to use it immediately and you’re using a source version of the engine it’s very easy to make the change to expose it.
In AnimInstance.h you’ll see:
If you change that to:
Then the node should appear as shown above. Really sorry I didn’t check that before suggesting it!
I’m too inept to modify the engine source, but I’m perfectly capable of waiting for a future release to get this functionality. It can be worked around by triggering custom events in the AnimBP itself, it’s just that doing it within a notify state simplifies the process a great deal. Thanks for the heads up!
Hey, same issue for me. I did change the .h file to the above but the node is still showing up the same as before. Is there something additionally you have to do to expose the updated node (tried restarting both Visual studio and UE4. Did some more searching in the .h file. The real function I am looking for is to identify how far into the animation I am to drive a variable into the next blend space. Is seems like this function would be perfect for that. Is there anyway to call this one through blue print?
/** Returns how long until the end of the animation AnimAsset we are (as a proportion between 0.0 and 1.0). */
UFUNCTION(BlueprintPure, Category="Animation", meta=(BlueprintInternalUseOnly = "true"))
static float GetAnimAssetPlayerTimeFromEndFraction(UAnimationAsset* AnimAsset, float CurrentTime);