Download

Extending UAnimInstance:: and adding Animation Sequence.

Hello everyone i been trying to extend the Animation Instance.
And in the extended version I want a ANimation Sequence i can change.

So in my class i have a member like this.



// The animation Sequance that will be played when the players presses attack.
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Player Class, Animation")
	UAnimSequence* CurrenWeaponAnimSeq;

And this works fine until i want to add it in the Animation Blueprint.
Here is a image of what am trying to achive, and the result am currently having.
41773ef506e84af48141beda36bfd5ccb11d1664.png

What am trying to achive is the Node above but this far i have failed in figuering out what class it belongs to.
How can i reproduce the node above with my costume member variable?

You want to play an animation from your CurrentWeaponAnimSeq variable, or set the value of CurrentWeaponAnimSeq when the game starts?

I want to play the animation from CurrentWeaponAnimSeq variable (like the node above the member), but i want to be able to change it at runtime.

I believe he is asking how to make CurrentWeaponAnimSeq variable a node/pose within the Animation Blueprint.
Personally, I would like to know that too.

Yes that is correct.

I’d be quite interested in knowing this as well

a while ago I asked how to play animations from code and the answer was “you need an AnimMontage”. personally I think having to make an AnimMontage out of every AnimSequenceAsset is a waste of time (for a project with 50+ animations) if using an AnimSequence is possible

The asset type in Animation Sequence so first I just assumed it be as simple as giving it the member.
Going over some API docs it seems the Play is indeed located in FAnimMontageInstance.

What i dont is where is it refrencing the Animation Sequence?

To anyone intrested i figuerd out a way to do this.
And its realy simple as well, i can`t belive i did not notice this before now. :slight_smile:

So in the Animation Graph when editing a state e.g: “Attack” in the State Machine.
When you right click and go to Animations and select what you want to play , under details check the “(As Pin) Sequencer”.

The only problem i found with this is that the derived Animation Instance also needs variabels for stuff like Time Remaining.
Am sure there is a solution for this as well other then the obviose, here is a image of the member and BP.

ANimBPSequence.PNG
I be back with more info as i work through a solution.

@neo, @Chosker: We have a solution :wink:
WCode

Wow, cheers! :smiley:

Note: Use node IsValid for checking whether variable is not a null pointer.

Yes i will, thanks for looking out :slight_smile: