Godot Version
4.2
Question
Pretty simple issue but one I haven’t been able to figure out a solution to.
Basically, I have a game where I’ve implemented text pop-ups. When the player clicks on a certain object, that object gets a new child Label3D with whatever text I’ve written.
I want to have behaviour where as soon as the player looks away from the Label3D the label gets removed from the game, so that when the player looks back at the object there’s no longer a pop-up there. However, seeing as I’m instantiating the Labels from script I can’t put the VisibleOnScreenNotifier3D node anywhere and set its bounding box to match the Label’s location. I could instantiate it as well, but the width/height of the labels can change quite a bit in between objects, so I wouldn’t know what value to set the AABB bounding box corners to.
Is there any alternative solution, or some obvious thing I’m missing that would allow this sort of behaviour? In general, just knowing how to instantiate the VisibleOnScreenNotifier3D from script (and set the bounding box to match whatever collider it’s a child of) would help a lot and allow me to accomplish a lot of what I’m looking for.