I need to know how get the current blend weight of some state on the AnimGraph/StateMachine using C++. Exactly the same thing that you can do in Blueprint (AnimBlueprint/AnimGraph) using “State Weight” node.
In UAnimInstance we have this function: float GetInstanceStateWeight(int32 MachineIndex, int32 StateIndex); exactly for that, but require the StateIndex and that is the problem. I can’t found a way to get the StateIndex from a FName.
Hi. Came across your post here as I was looking to get the state weight myself from blueprint.
I did not manage to do that (within regular blueprint, I know it can be done in the animblueprints state and machine -graph).
Using your code I ended up with this that works, at least for me:
( I actually expect that there is a way to get the weight already in blueprint and that I haven’t found it yet. Anything else would just be very lacking for such an engine… )