Blueprint Interfaces - Trying to pass a string

I’m trying to send a String from an Actor BP to a Animation BP. I tried to define the string in the Actor BP and then have the Animation BP print the string but I’m not seeing any output in-game.

This is the Event graph of the sender:

This is the BPI:

This is the recipient:

For good measure, I added an additional Actor BP in the world as a second recipient with the same code, but that is not giving any output either.

Not sure where the problem is, all help is appreciated.

In your first pic, you’re calling the event on yourself. I’m assuming you want to call it o the anim BP?

first , you should implement the interface in your animbp .
second , call that interface function you made and dont link self to the target pin , u should link a reference to the animbp cuz that’s where the interface is implemented .
in order to get a character anim bp reference , take the mesh and from it - get anim instance . thats your anim bp reference .

hope it helps

Right, bear with me here because I don’t understand BPIs at all and I’m pretty new to coding and UE5 in general.

When you say “implement the interface” what do you mean exactly?

https://www.youtube.com/watch?v=G_hLUkm7v44

I presume you are talking about the “self” reference in the first picture. If I remove the “self” reference and cast it directly to the ABP, then as I understand it, this would defeat the point of using a Blueprint Interface and it should be avoided.

Was that what you were suggesting?

Correct :slight_smile:

Don’t send the message to a ‘type’, send the message to an ‘actor’.

In this case, because you’re talking to the anim BP, you have to know it’s type first, so there’s not much point :rofl:

Still running into issues here.

So, I tried to add the target BP as an “actor” in the sender BP and changed the reference from self to this, as follows:

And just to make sure doubly sure that the AnimBP was active in-game, I made it print a string on startup. Unfortunately, despite that the AnimBP is definitely active, still no sign that my Pass String is doing anything.

…Just in case I didn’t reference the class of an AnimBP properly, I tried again with a separate reference to an actual Actor BP as a recipient with the same code as the AnimBP and absolutely no sign of life either.

Did you do ‘get anim BP’ and call it on that?

I see the BP you’re testing in there doesn’t have a skeletal mesh, so it won’t have an animBP.

When you would normally drag off the skel mesh and use ‘get anim BP’, you can talk to it with an interface, if you want.

That way, you just talking to a generic anim BP, not your particular one ( as far as the BP is concerned ). In fact you ARE talking to your anim BP, but the character BP never knows about it.

I see the BP you’re testing in there doesn’t have a skeletal mesh, so it won’t have an animBP.

Confusion - does it not have a skeletal mesh? I thought this at the top right-hand concern was its skeletal mesh:

I suppose could try and drag off a new skeletal mesh and see if that works.

Your pic from before

no mesh :wink:

I can do this in the first person character

In the first person character anim BP

( It works )

Finally…thanks so much

1 Like

It works? :slight_smile: