I suggest using NodePaths or Ref. But using Ref here isn’t really that great since I’m assuming that the camera is inside the tree, so it already exist outside of the class. Only use refs for stuff that doesn’t use the _notification method because if that method is use that means it must have some functions that won’t work outside of the tree. I mean you can probably still attach this Ref<Node> to the tree but I feel like that goes against how you’re suppose to structure your scene trees. The great thing about nodepaths is that when you call it by:
get_node_or_null check if the object still exist inside the ObjectDB. I mean you don’t want to call an object that’s already been deallocated.
also, since you’re using nodepaths you have to check before setting it in your setter that it does point to a Camera Object, otherwise you can create a String warning; variable and override the virtual String get_configuration_warning() const; function to report the warning to the editor.
You can also use emit signals. It depends on what you’re using the Camera for.
You don’t ever use raw pointers when programming in Godot.