Godot Version
v4.4.1
Question
So it just the basic use of VisibleNotifierScreen2D, I try to hide when its outside using hide() and show it back again using show(). But the show() method seems not working because when I entered again, it still not visible, even though the collision is active. What I done wrong with my code?
Code
func _on_visible_on_screen_notifier_2d_screen_entered() -> void:
show()
animated_sprite_2d.visible = true
set_process(true)
set_physics_process(true)
collision_shape_2d.disabled = false
func _on_visible_on_screen_notifier_2d_screen_exited() -> void:
hide()
animated_sprite_2d.visible = false
set_process(false)
set_physics_process(false)
collision_shape_2d.disabled = true