Help to fix "Accessed none when trying to read property"

Hello!

I’m doing one system for a skeletal mesh switch using widget buttons. In this system I have one blueprint containing the first skeletal mesh and a widget blueprint.

The meshes should switch using a function with a variable like this:

And the onClicked events are connected to the function to call the skeletal meshes

After compiling and testing it I get this error message:

I was digging into the forums and the possible solutions I’ve found is to add a “Is Valid” node to check the variable and mesh., but I’m not sure how to do it properly.

I’m new to blueprint and would be grateful to have some assistance and advice on this!

Thank you and have a great day!

Looks like the character variable is not valid. Can you try print string of this character variable?

When you CastToBP_DinoCharacter off of the As BP Dino Character did you promote to Variable

You can use “Is Vaild” by placing it right after Mesh Switch. The “input object” should be your Character variable and then after the “Is Valid” execute pin you can print a string saying something like that it is valid, and the plug it into the Set Skeletal mesh Asset. The “Is not Valid” should print something that says that it is not valid.
image

When you test it, do you play it or are you testing in the editor? Becasue I think you need to cast inside the “Event begin play” and not “Event Construct” if you are going to use it in play mode and not editor.
image

Thank you for you reply!
I did create one Is valid node and the print strings. It returned to me not valid. It still access none trying to read the variable.
The function graph is looking like this now

I’m playing it and can’t add one Event BeginPlay in the widget graph.

Just for reference, I did exactly what this guy did in this video. If you jump to minute 3:44, that’s the part where he created the variable and the function.

https://www.youtube.com/watch?v=rfcTM1jfbsM&t=280s

Thank you!

Join my Discord, Ill show you AreWeYoutubing