Error while trying to hide a text render

Hey guys, i’m new to bp scripting and i have a door with a text render that is supposed to be shown when the player looks a it and hidden when he doesn’t, so i have a line trace every tick on the first person bp and when it hit the door the text appears, its working! but it doesn’t hide it and i have these two error messages:

“Blueprint Runtime Error: “Accessed None trying to read property K2Node_DynamicCast_AsPorte_Blueprint”. Blueprint: FirstPersonCharacter Function: Execute Ubergraph First Person Character Graph: EventGraph Node: Set Visibility”

“Blueprint Runtime Error: “Accessed None”. Blueprint: FirstPersonCharacter Function: Execute Ubergraph First Person Character Graph: EventGraph Node: Set Visibility”

“porte_blueprint” is the door bp and “Interact” is the text render

When the cast fails, it means the object isn’t there or it’s another, undesired object type. And you still try to access it, hence the error.

If you scroll to my answer here:

https://answers.unrealengine.com/questions/1042681/impossible-to-create-game.html

There’s an example demonstrating a very similar behaviour; the boxes pop up when the player looks at them and return to their normal state when they’re no longer being looked at.

Hope it helps.

It worked! thanks for the help!