Widget REF - Accessed None trying to read property

I keep getting runtime errors about “Accessed None trying to read property Profile Widget REF…”

I have no idea why calling the Function “Create Character Button” requires a ‘target’, but it wont compile without one, so I created a reference to the widget in which the Function resides. This widget is what creates the button and image and puts it all together, and hopefully returns the result at the end here and gets added to the ‘horizontal bar’.

The idea is that it takes an array based on a table, creates button with character images, and puts it on bar.

Anyway, the most common time waster I have is these Target errors. Please help. I waste so much time trying to figure this out.

How did you set the widget ref?

image

It points to the Character Profile widget- This in turn has the Create Character Button function which is called by the TeamSelect widget. The idea is it creates a button for each of the characters a player has in their inventory and loads it into the bar. I actually want it to be a scroll bar but I cant seem to reference it, so Im using a horizontal bar for now just to get it to work.

Ok, but I see here, that your variable is of TYPE Character Profile, but it is not assigned. That’s why you’re getting the error.

For instance, you need to create a widget of this type, and then hand that reference to your button routine.

1 Like

assigned? the Character Profile is a widget… , not sure what ‘type’ refers to.

I created a test var with type Widget. I tried to set the default value, but there is nothing in that drop down.

This reference stuff has been ■■■■■■■ me for a while in other areas too. Im missing a specific piece of knowledge that I feel like will make everything much easier.

I can make a variable of type ‘widget reference’, but I can’t use it.

I have to add one of those widgets to the viewport, which gives me a value I can assign to the variable.

I can then pass that variable to some other routine.

1 Like

Ok. I do that with the TeamSelect widget. The Character Master actually creates and adds the TeamSelect to the viewport. The CharacterProfile widget isnt added to the viewport anywhere. Its purpose is to be added to the TeamSelect widget dynamically, not directly to the screen. (wondering if i even need the button to be separate. seems i should be able to create and add the button inside the TeamSelect widget graph).

Now, looking at the TeamSelect widget, no widget is ‘created’, and if I look at the CharacterProfile widget I find that no widget is actually created there either.

The function in the CharacterProfile widget exits to change the parameters (change image) of the button based on an array output. It doesnt actually create the widget.

Based on what you said, it would seem I need to use the Create Widget inside my TeamSelect widget where the array is created, broken out, and which calls the function in the CharacterProfile widget.

Ill give that a go and let you know what i come up with .

1 Like

I never use nested widgets, so I’m not sure, but what you’re experiencing is because the variable has no value.

I got it fixed.

Your original response was correct, i had selected the wrong class input on the create widget (is that a function, not sure what the box means).

Thank you.

1 Like

For what its worth @ClockworkOcean here is what the whole problem was about -

image

Eventually ill figure out how to put those into a horizontal scroll box with a bit of padding between them, but those buttons were dynamically ceated based on an array of character that belong to a specific player. When clicked on, they will be selected for a match and go into another array to be spawned.

1 Like