Widget reference isn't valid error

Hello
I’m currently having an error “Blueprint Runtime Error: “Accessed None trying to read property CallFunc_Create_ReturnValue”. Node: Add to Viewport Graph: EventGraph Function: Execute Ubergraph X Line Generator Blueprint: X_Line_generator” based on the blueprint shown in the image below.


As the viewport and remove from parent are connected to the create widget return value, the code runs without error but after a couple of cycles or a set period of time, I receive the error stating the create widget return value is no longer valid.
Any help would be appreciated.

1 Like

Create references and use them. You can’t rely on Cast / Create nodes to store it forever. You’ll also reduce spaghetti code this way.

Same with widgets:

When it comes to the Branch Delay Twisty Thingamabob, consider Timers:

More versatile, come with features and much easier to debug when things go haywire.

2 Likes

Thank you for the help, I tried setting the references as variables and it worked. I am quite new to Unreal Engine so I didn’t think about this method, I will try to change my delay sections like you have here and see how it affects my programme.
Thank you again

1 Like