Retreiving float from Widget

Hi There,

Thanks for the help in advance.
Currently on 5.3 using BP.

I am currently controlling and keeping progress within a widget. (i thought it made sense to just call an event in level bp or PC | but now i know)

I am trying to get the float to the level BP to trigger death screen but no matter what i try it seems impossible to call an event dispatcher either the closest i got was using getAllWidgetsOfClass, and then using get from the retreived array.

But it fails with : Blueprint Runtime Error: “Accessed None trying to read property CallFunc_Array_Get_Item”. Node: Get Percent Graph: EventGraph Function: Execute Ubergraph Main Room Blueprint: Main_Room

Im using the reference to call a function to get the progress float.

Any help would be much appreciated

Where do you create the widget? you can store a reference of the widget in some globally accessible place like your gamemode.

You can go to your gamemode and create a variable of class ‘yourgamewidgetclass’

then whenever you create your widget you can do something like this:

CreateWidget
get gamemode–>cast to ‘yourgamemodeclass’–>set ‘yourwidgetvariable’

that way you stored the widget somewhere

then for accessing from other bp:

get gamemode–>cast to ‘yourgamemodeclass’–>GET ‘yourwidgetvariable’–>get percent

1 Like

image

1 Like

Thanks for your reply,

My widget was attached directly to a pawn i created

which meant i didnt have a reference in BP, when i created a new widget in BP, it was a second instance that wasnt actually rendered in game :(.

The issue in the end was my Get All widgets in class was “top level Only” im guessing this wouldnt actually find the widget which way a couple levels down attached to a pawn in scene.

Thanks for the tip in the future i’ll make sure to create my widget directly in BP.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.