get_node() error appears even though the scene is running perfectly fine (the node included)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Akshara31

I am trying to display an interaction prompt whenever the player looks at the NPC(Robot in this case). To display this interaction prompt text in 3D space, I am using a 2D no sampling viewport called DialogueViewport which is a child of Rigid body: Robot. However this error keeps showing up in the debugger saying that DialogueViewport is not found even though it shows up when I play the game with all its intended functionality.

Image: https://drive.google.com/file/d/1PMr0F7xeE0SuvUmZg4G4BhL87g3eqzOk/view?usp=sharing

I cannot see your screenshot, you probably forgot it.

Bubu | 2021-04-22 17:52

Right click on the broken image icon and open it in a new tab. I used a https link to share my image and that seems to have caused some issues.

Akshara31 | 2021-04-22 17:59

exuin | 2021-04-22 19:57

:bust_in_silhouette: Reply From: exuin

Yeah viewports have this issue. See this GitHub issue for discussion and work around.

:bust_in_silhouette: Reply From: Akshara31

On further researching I found the reason for this cause is due to the meshinstance called before the viewport node you will run into an error only on the first frame. This can be easily fixed by interchanging the scene tree to have the viewport node called first.