AnimBlueprint, Blueprint Interface and Does Implement Interface

I have built a system to check whether Blueprints contain a Blueprint Interface.
My system works for default Blueprint classes, but the Does Implement Interface returns False for Animation Blueprints, even though the Animation Blueprint has fully implemented the interface.

I guess there must be some logic behind this I am not currently seeing.
The reason why I want to use AnimBlueprints is to easier send AnimNotifies to the blueprint to create events related to animations. I rather use as few assets as possible.

So why does the function not find any interfaces in the Animation Blueprint?

Thanks for any help!

That’s weird, I added an interface to a third person anim BP and this worked, it printed true.

Okay, so then there is no fundamental difference preventing the AnimBlueprint.

What I am doing is trying to create a general interaction system that can be applied to any Blueprint that implements a specific Blueprint Interface.

I suspect that my problem has something to do with a Line Trace By Channel being used to identify the actors in the level. This happens from the Player Character actor Blueprint, and this system works fine for normal Blueprints.

I see for example that you use Get Anim Instance to reference what I believe is the actual object containing the interface in Animation Blueprints, but instead of referencing a specific mesh what I use is the Break Hit Actor returned from the Line Trace. It might be that the hit object does not actually return what it needs to in order to successfully test the interface implementation.

For example, if I don’t know if the hit actor is a normal Blueprint or an Animation Blueprint, how should I set things up to be able to handle both classes from the Player Character Blueprint?

The issue is a line trace will not hit an anim blueprint, you will hit the actor which could be the character and you can also get the component hit which could be the capsule or mesh.

Maybe you can have the actor you hit return a list of objects you can interact with within the actor, for example the character has an interface that returns all objects you can interact with, for example return the anim instance, and any components you can interact with.

So line trace, hits the character, character returns an array containing the anim instance etc, and then you can use the anim instance reference to execute some interface on it.

I am thinking of perhaps inspecting the class of the hit actor using Get Class, and make a special case for Animation Blueprints.

That way I can use default Blueprints as well as Animation Blueprints in the same system.

I will give it a try.
Thanks for the input so far.

I think that defeats purpose of the interface, which is to stay class-independent.

I’m not clear on exactly what you aim to accomplish, but if you just want to communicate with an actors anim instance without caring who the actor is, you can just implement the interface on the actor.

Then, in the actors implementation for some interface event, you can do whatever you want with the assigned anim blueprint.

Or like kaidoom is saying, if you wanted the other class (the one who is shooting the linetrace and asking questions) to have access to the animbp, you can just return animbp as a result from the interface function.

Then if you want to further communicate with the animbp without referencing the class directly, you can interface with it.

So it’s like this:

  • ActorA > linetrace touches ActorB
  • ActorA uses interface function to ask, “You got an animBP? If so, let me see it”
  • ActorB returns the animbp
  • Now actorA can talk with the animbp, either directly via casting or with another interface that can be used to query or directly manipulate the animbp

Somebody could correct me, but I think the “does implement interface?” is redundant because an interface message can silently fail. Like if the actor doesn’t implement the interface, that’s no problem. So I dont think you need to use that node as a validity check.

1 Like