You can try this: I also had some issues figuring out an easy way to communicate between blueprints.
It is done using a Blueprint Interface. Easy and fast.
There is a node, get player controller you could use in the event graph, but I donât think it works in the Contruction script. Then cast the Player Controller to your PlayerBluprint.
Has someone made a tutorial on this yet? Iâve tried all that Iâve read I either get a empty var, or when casting to by Get all actors of class it crashes the editor.
Do you still need this?
This should be way easier. There should be a hierarchy with the variables. I need to define a number of global variables and level variables to be accessed by all the things on the map⌠any other engine its easy as cake. You define the variable in the code in the right place and access it from anything else⌠I wanna scream that this is so complicated here
You can see! helpful for you!
- In your event graph place âGet All Actors Of Classâ Function and set the âActor Classâ to the BP your trying to get your variables from
- Drag off from âOut Actorsâ and place a âForEachLoopWithBreakâ
- You can now drag from the âArray Elementâ on the âForEachLoopWithBreakâ and you can now see your variables from your other blueprint
It is core functionality. There is no reason you need a âBlueprintCommsâ blueprint just to communicate between blueprints without using level blueprints or dispatchers.
There are many ways to communicate between blueprints, but the simplest and most generic is to use âGet all actors of classâ or âGet components by classâ. (All blueprints except the level blueprint and the gameMode blueprint are actors or components.) You may need to uncheck âcontext sensitiveâ to search for these nodes. Also, note that these 2 nodes are slow, so donât call them every tick; instead, call them on BeginPlay or in a constructor, and then save them to a variable.
Once you have the actor or component, you can find all of that blueprintâs variables by searching Class->BlueprintName->Get VariableName