0 votes

I have this scene where the node hierarchy made it so that the default root viewport isn't where the main gameplay occurs and instead happens inside another viewport to make space in the screen. Visual Representation

Now I want to emit a signal from VisibilityNotifier2D each time the node enters/exit the gameplay viewport/screen, but VisibilityNotifier2D doesn't emit a signal.

What I have in my game:
The gameplay viewport is scrolled via the player's camera and I want it so that each time an enemy enters/exit the gameplay screen, their VisibilityNotifier2D would a send signal to its parent node to start/stop the parent's despawn process.

Godot version 3.3
in Engine by (19 points)

1 Answer

0 votes
Best answer

I made the parent of the VisibilityNotifier2D a Node instead of Node2D which means that the VisbilityNotifier2D's "Detection Rectangle" didn't move at all and stayed at 0,0. This meant that what you see in-game is not reflecting what's actually happening behind the scenes.

Also to answer the question. The "Screen" is the entire window the game is playing on. You will need to specify the viewport if you're using the same setup as I have where the meat of the game is in another viewport to make space for UI/HUD elements on the side of the screen.

by (19 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.