I wanted to access the custom event (EnterVoiceButtonPrompt) from one blueprint to another.
I have created a variable called WBP Text to Speech and i have added the variable type. I got the call function (EnterVoiceButtonPrompt).
It allows me to run the program. But i get an error here saying
Blueprint Runtime Error: “Accessed None trying to read property WBP Text To Speech”. Node: Enter Voice Button Prompt Graph: EventGraph Function: Execute Ubergraph Voice Record Widget Blueprint: VoiceRecordWidget
How do i solve this issue ?
Everynone
(Everynone)
December 5, 2023, 10:11am
2
A variable is not value. Where is the data? Where is the other blueprint you’re trying to sent the data to?
This variable you’ve created could point to the desired object, but which one?
This is the variable (WBP Text To Speech) that i have created in a blueprint called VoiceRecordWidget.
I wanted to send the data from VoiceRecordWidget to WBPTextToSpeech1.
Everynone
(Everynone)
December 5, 2023, 11:18am
4
I understand that. Imagine you created an integer variable but never put a number inside. The value of that integer is zero.
That’s very close to what you now have, an empty variable. Where is the object this variable is supposed to refer to?
Creating a variable does not automagically create an object.
Think of the actor / widgets reference variables as of arrows (pointers). You need to point that variable at an instance of an object.
Where / what is WBP Text to Speech? How did you create it, how did it make it into the game? Once you know where the object is, you can then have a variable refer to it.
I see… thank you for the explanation. So this variable is basically null.
Now, if we ignore that variable. What can i add in place of target.( as shown in the image)
Everynone
(Everynone)
December 5, 2023, 12:56pm
6
Precisely.
The reference of the actual object instance you want to communicate with. Where is it? What is it? You never explained…
To be more precise on what my objective is.
I simply wanted the string (Recognized Words) data to move from VoiceRecordWidget blueprint to EnterVoiceButtonPrompt Custom Event of WBPTextToSpeech1 blueprint. (So that the string data continues to flow to the desired nodes)
WBP Text to speech variable, i have added just because it was giving me an error by simply keeping Target as blank.
How can i achieve the flow of data from one widget bp to another.
Everynone
(Everynone)
December 5, 2023, 2:33pm
8
As before. You need to explain where, how and when you create those widgets. We’re walking in circles.
Where, when and how do you add those widgets to the viewport?
It’s very clear what you want to do. But the editor does not know where your instances are. It’s your job to know this and tell it where to find them.
Please explain how those two widgets that need to communicate make it into the project.
Did you Add them to Viewport? When, where? Did you use a widget component? In which actors? Where are those actors? In the level? Spawned dynamically?
The editor feels exactly like you do, it does not know where things are unless you tell it. Actors / widgets are unaware of other actors / widgets.
Imagine if had 10 widgets, not 2. You need to keep track of where things are and connect them.
1 Like
So basically I have added blueprint called TextMainMenu to the Open Level Blueprint.
In that blueprint, I have a WidgetSwitcher which has those two mentioned blueprints.
This is how it is being displayed onto my Viewport when I run the program.
1 Like
Everynone
(Everynone)
December 6, 2023, 8:10am
10
Both widgets are in a widget switcher, got it!
in the widget with the switcher, the one that has both A & B:
In short: when the Event Dispatcher is called, the Custom Event in the TTS widget will trigger.
There are more ways to communicate this but that’s the most convenient and does not require setting up additional reference variables.
2 Likes
Finally!!
It’s working as I expected it to be.
I can’t thank you enough for the information that you have provided.
1 Like