Blueprint working in editor,but packaged

Hi everyone
I make a UMG button for hide and unhide actors in scene as below

It’s working fine in editor,but nothing happen when click it in packaged game

What’s wrong?What should I do?

Thank you.

Try to use the node “IsValid?”. From this you can test if your menu is created. Ah…do you create the umg widget anywhere?

It can happen, that when you create your widget and use this Event on construct, that the construct Event is called before your widget is created. So you casting to nothing.

Set a print string on cast failed and see what happen.

I would suggest to allways set a print string with a message: One for succesfull and one for failed. Double check everytime if you actor is valid or not and print that out with the print string.