What are the advantages of spawning enemy object by using VisibleOnScreenNotifier2D?

Godot Version



<I have no prior experience of coding and am trying to make 2d platformer. For the study purpose, I was looking at the code of Mega-Man Engine, and realised that they use VisibleOnScreenNotifier2D to spawn the enemy object. What could be the difference with simply instancing and placing the enemy node to level scene?>

If enemy has VisibleOnScreenNotifier2D, it act as it emit a signal of screen_entered or screen_exited when the enemy is out of screen or not example enemy goes out of screen then it can emit screen_exited and in that function you can do like that enemy.visible = false therefore for make it easy you can use VisibleOnScreenEnabler2D, it act automatically without codes, when enemy out of screen, it changes the visible