Download

Animation blueprint and inheritance

So, i’m trying to make a baseclass from which to inherit all the basic functions ect.
except i cant find a way to inherit a callable instance of the anim instance.
I need to cast to it, but casting doesnt accept a variable.
How should i go about this?

I don’t really understand what you want, but all the functions that already come in unreal don’t need the cast.
Like this one from morph or for example play montage

well, if i make a child blueprint from this, and i dont cast to its anim instance it returns a None error


Which also means i have to add this piece of code to all the children independantly just to change the cast to anim instance.
I feel like im missing something and that there’s a better way of handling this.

ok, you want to use different animbp for each monster, but use changeFullnes in monsterbase for all of them.
For this specific case, as I already said, you do not need the cast for the morph or for example to fire an animmontage.

But if you want to call custom event/funcions or change variables in the animbp you will have the problem you say.
The options I think you have are:
-Have a single animbp for everyone.
-Create an abstract class above the animbp from which all animbp inherit and which you would cast. I don’t know if it can be done only with blueprints (I’ve tried that with blueprints and I’m pretty sure you can’t, since the highest in the hierarchy is the only one who controls the animgraph)
-Use interfaces in the animbp, although I suppose you would end up repeating the code in each animbp

1 Like

alright!
Thanks for your time!
i understand better what im dealing with now.