Help with basic blueprint communication please?

Hi. I really need help understanding how to communicate between blueprints. I uploaded a video (1 minute long) of my problem here:

For those who don’t want to watch the video, here are the steps I took in a new, blank project.

1.) Created a new actor blueprint called “ScoreBP”
2.) Made an integer variable named “score” with a default value of 5
3.) In the level blueprint, created an object reference to the blueprint following this documentation: https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/BlueprintComms/index.html
I followed the 8 steps under “Creating an Object Variable for the Target Blueprint”
4.) In the level blueprint, I got the score variable from the object reference and set it to print when Z is pressed:


5.) When I press Z, the default value of 5 is not printed. 0 is printed instead.

Just wondering how to get it to print 5 instead. Any help with this basic issue would be greatly appreciated :smiley:

I think that you need set the variable scorebp with some actor of type scorebp, this a commun “noob” error :stuck_out_tongue: mix the variable with the spawend objects that exist in runtime.

The blue variables store actors, the actors only exist in runtime, neither placed in the level or spawned in runtime.

you are jumping straight into an advanced subject in the docs, have you worked with BP communication before?

also scroll down and it will show you how to cast to that BP from the one you are trying to access it from, also most of the time you have to ‘set’ the Object variable when you create it in the BP it is used in.

if you look in the How To section of the same part of the Docs there is some things that might help, you can also do a search https://docs.unrealengine.com/latest/INT/ that should help as well.

that part of the Docs basically just shows you how to create the variable and make it public, not really how to access it.

also not sure why you would want to access the score from the level BP, maybe use your map BP or even Character BP, later use an UMG BP

also best place to ask questions about BPs is in the BP development forum, most won’t see it here.
link: https://forums.unrealengine.com/forumdisplay.php?6-Blueprint-Visual-Scripting

I don’t necessary want to access the score from the level bp. I just used this as an example. I really just want to know how to communicate between blueprints, as I need to be able to access variables from other blueprints in my actual project. I will look through the documentation more and try to find something that helps though.

have you tried:
https://docs.unrealengine.com/latest/INT/Engine/Blueprints/HowTo/index.html

You don’t created a actor, you are create a blueprint. The actor is create when drag a blueprint in the level or spawen with code.

Right, but what kind of blueprint should I create then? What parent class should it derive from?

did you try doing that example tutorial I linked above? it would make a good place to start understanding what’s going on :wink:

also this: https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/BlueprintCommsUsage/index.html

it’s a lot simpler than it looks once you work with it for a while

Drag the blueprint ScoreBP to the map, now you have a ScoreBP actor, find the the variable “ScoreBP” in level blueprint and fill it with the ScoreBP Actor.