Is there any ways to pass variables between two blueprints without using level blueprint or event dispatchers ?
I am trying to simply pass variables between a bluprint holding input data and a player controller, or an animgraph and i cannot get anything to work
I listened to the Unrealengine4 channel on youtube videos about blueprint communication on youtube and the exemple wonât really fit my needs.
This seems to be exactly what I need. But thereâs no âTargetBlueprintâ in my list. Is this already the result of an upgrade I didnât get for unsubscribing instantly?
If I understand your goal correctly then the type should be whatever type your other blueprint is. (In the example case this is TargetBlueprint).
So if you have 2 classes:
FirstBlueprint
SecondBlueprint
and you want first to âtalkâ to second then you would add a variable to FirstBlueprint whoose type is SecondBlueprint.
If you then drag the SecondBlueprint variable into your graph and drag off the pin you should see all the functions you have exposed in SecondBlueprint
Thank you for your answers, i looked at the blueprint comm, the target blueprint could work but the easiest way would be to CAST TO, but unlike the documentation, i found no way to find the Cast To something list.
I tried removing context sensitive, I tried in blueprint, level blueprint or anim blueprint, nothing
To Cast to something, youâll want to drag from the pin of the object youâre trying to cast FROM. In this example, I created my own player controller blueprint called BP_MyPlayerContoller and another Blueprint called BP_Input. Inside BP_Input, Iâm getting the default player controller. If I drag off the Return Value from that, I can cast to my own BP_MyPlayerContoller. Then I can access custom variables in that class. Hope that helps!
Additionally, my understanding is if you unsubscribed instantly you should still get patches until the end of the month. However iâm not 100% sure on this.
The controller is the context in the above case. In your case your probably going to want to drag the variable into the graph window (the variable that is the other blueprint your trying to âtalkâ to). When you drag you will be given the option of get or set. Choose get. Then drag from the pin in the node it creates.
In your screenshot the âCurrent Take Nodes Completedâ variable is an INT. The variable needs to be an instance of the blueprint you wish to communicate with. So if you want to call a function on MyShinyBlueprint then the you need a variable in your blueprint whoose type is MyShinyBlueprint. Then when you drag the pin off the GET you should see any functions you can perform on it.
What i did was:
-Create a blueprint object getting the AxisInput each update.
(I tested it by printing in game and it works.)
-I added a variable of that type in my other blueprint
I get the value of that variable and print it.
I does nothing.
I guess itâs because my variable is âemptyâ but how to i set my variable to the other blueprint instance ?
Drag and drop, or sleect and rightclick does not work.
It always shows me 0/0, even though the values are actually changing inside my player blueprint. I also get these errors for every frame after playing:
Thatâs its type - but you need to set it with the instance of the blueprint you wish to communicate with.
One way you could do this is to add a âbegin playâ event to your MyPlayer blueprint have it get a pointer to the hud (which you will need to cast if you have a custom hud) and set the PlayerBlueprint variable within your hud from self.