How can I change the text within my widget blueprint via a variable from another actor blueprint?
What I'm trying to accomplish I have an actor in my game and when you scroll your mouse over this actor a 3D widget pops up (widget is a component of the actor) with the name that you set for the actor. I have it set so someone can input the items name via an exposed variable within the editor.
What my problem is I cant send an editable text string variable from the actor blueprint to the widget blue print and have the widget text be changed. I have read over every forum post I could find and still have not found an answer. People seem to have success but I cant understand what they did differently. I'm sure the error is on my end
How I have it set up The 3D widget component (located on the main actor) is getting its blue print data from a widget blueprint. On this widget blue print I have set a variable binding for the widget text so the text can be changed. No matter what I do I cant get the two blue prints to communicate the text variable. I try casting to my Actor blue print from my widget blue print but I always get "the type of object is undetermined error." I'm not sure what I should hook in here and everything I try does not work.
Any insight would be appreciated.
asked Mar 26 '16 at 10:41 PM in Blueprint Scripting
Hi, This problem has been open since Mar 16. In case you haven't found a solution yet or for anyone else who needs a solution, you might try the following.
I faced a similar situation, and with inputs of Nick Jackson's reply managed to fix the problem. A big thank you to Nick for this.
In the actor blueprint (in your case I assume it is 3DWidgetRollOver) get a reference to your widget component whose widget class parameter you have set to the 3D Widget. Then drag out a pin from the reference to "Get User Widget Component" node. then drag out a link from the Return Value of the "Get User Widget Component" to your "Cast to Object_Select_BP" node. This should provide it with the reference it needs.
Just for info I am using UE4 4.12.3.
answered Jul 23 '16 at 06:10 AM
You're talking about communicating from actor blueprint to widget blueprint. Setup a Custom Event on the Widget with an input parameter of whatever text you are trying to update.
Then call this Custom Event from your Actor whenever you want. Make sure you setup a reference to it first:
Then call it like you would any other Custom Event.
answered Apr 06 '16 at 01:44 PM
There is a better way to do this without casting. Casting too often can cause performance issues.
While not exactly what is talked about, this works much better.
Follow this question
Once you sign in you will be able to subscribe for any updates here