Calling a function in another class requires target? Is it a bug?

So, this is my setup:

It’s a simple function that, right now, just adds a value to a variable (which will later be the score and drawn on the hud)

This is my call inside of another Blueprint. However, every time I compile I get the “Pin Target must have a connection” error. In the Wiki the Graph could be compiled without that input.

Does anybody know what is happening here? Doesn’t even matter in which Blueprint I create the class, it’s always the same error. It also doesn’t matter if I place the actor in the scene or not.

Thanks in advance!

[EDIT] It doesn’t matter where I try to call that function. Before destroy actor, or after. Always the same. Everything worked fine to this point but right now I’m just stuck.

I think a lot of people misunderstood the term “self”, as it is derived from programming language, so it could be confusing.
(I hope someone better than I do in ELI5 English can make a simple wiki page and deal with questions like this one. Don’t get me wrong, it’s not bad question, just frequently asked.)

YES, you need a reference to the object that you try to call the function with if it’s called by another blueprint object.
Imagine, you have one master BP that calls functions(ie level or GameMode), and you have several actor to be called that are instance of say, ItemBP.
If you just call the function, how do game know which one of ItemBP_C?? to call? Well, they don’t automagically work, so you need to tell them which one to call.

The only exception is when you call the function with in ItemBP’s graph, where target “self” means exactly like you’d guessed, which is whatever item instance currently running this event execution line( white line in graph).

To call from another BP object, you have to save a reference or get it indirectly(like trace or collision), or pull from everything that is the class you want to call(have to get those from level or GameMode).

Here a offical tutorial calling from one two other blueprint 'on overlap’
excuse my english.

“Self” in your case if i not wrong (i noob) mean target->“Blueprint_Target” and your AddScore its in “Blueprint_Scoremanager” ins’t self, that only must work when you call it from Blueprint_scoremanager, then you can reference with ‘self’. In other case you need provide the target. “Self” mean the target its THIS blueprint or THIS instance of blueprint.

if i wrong someone correct me.

So yes, I understood that correctly. It’s my luck that I did some Basic C++ and Java years ago, so my guess was correct!

Here a offical tutorial calling from one two other blueprint 'on overlap’- YouTube

That, sadly, doesn’t help. He’s not using any functions to do that.

So, as my guess was correct I tried to do that before I posted here (selecting the correct target). However, when I wanted to input a class variable the pin greyed out and I couldn’t connect it. Why? Do I need to search for the actor every time I need to call that function like in the video? And what if the actor doesn’t exist in the level?
I was able to solve everything by myself to this point but now I just have a headache :stuck_out_tongue:

i use something like this:

keep reference of that actor in actor var and use for call the funtion.

Thank you!

Gonna try that when I get home from work and report back if it worked!

I can’t get it to work. I’m frustrated as ****.

  1. How do I reference THAT specific actor in my class where I want to call the function from?
  2. Why does my class have a _c in the end?

I’m sorry but I’m either completely blind or just dumb, but can someone post me a screenshot of a BASIC setup on how to call a function in another blueprint? This drives me nuts.

How exactly does the rest of your blueprint work, specifically this one


I’m a novice, but I’m guessing you’re trying to supply the “killer” to the target of the Add to Score node right?

It’s pretty simple. I got that “Blueprint_Target” Actor which works as “Enemy”.
Once you shoot it twice (it’s a variable you can set) it destroys itself, plays a sound and a particle effect. What I want it to do NOW is just to call a function in my ScoreManager (which should handle everything score related, but I can place it wherever I want basically, even in MyGame) that simply takes the current score (which is a variable in the ScoreManager Blueprint) and adds a value to it which I transfer over the function call (as I want to add different “enemies” with different rewards). This value should then be printed on the screen.

I know how to print it on the screen, but I always get the error that I posted above… always. I think the problem is that I don’t understand the setup right now. That’s why I’m asking for a simple screenshot of two classes… one that calls a function and the other class HAVING that function.

Oh and: I placed one of my “ScoreManager” Actors in the map. Is that even necessary? Or can I simply spawn them on “Start play?” Or what is the best way to do it?

ok i do a video now, its basic (no more 5 minutes i think), with a very basic example you must do the rest, if work ( i have problems record videos )

anyway rember i a newbie here, (only one moth experience in that world) :rolleyes:

uploading now here:

its very basic for do a video but with my bad english better a video than explain it with words :smiley:

you have a problem with some concepts like me when begin last month (and now), its a slow learning without basic concepts about engines or ‘make games’ but with time and help of other users with more experience, we can learn something. :wink:

I love you! Seriously, one internet for you good sir!

I totally forgot about the Level Blueprint… now I have to find out how I can define the score variable to ALL Enemy actos in the map (probably works with “Get All Actors of Class”)

remenber blueprint interface for communicate with blueprints, i not play with this yet but i see few tutorials and are useful

check videos in youtube, official and no-offical ones about blueprints.