Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VisibleOnScreenNotifier2D screen_entered or screen_exited signal will only emited once. #72905

Closed
takhimi opened this issue Feb 8, 2023 · 2 comments

Comments

@takhimi
Copy link

takhimi commented Feb 8, 2023

Godot version

4.0 rc1 official

System information

Windows 11, RTX3070, Vulkan

Issue description

I noticed that the VisibleOnScreenNotifier2D "screen_entered" and "screen_exited" signal will only be emitted once when on or off screen. It will wont be fired or emitted again after that.

Steps to reproduce

1)Create a sprite and add VisibleOnScreenNotifier2D as child
2)Add camera2d and add codes so that the camera can be pan or move (use arrow keys for camera movement)
3)VisibleOnScreenNotifier2D will make the sprite visible when on screen and visible=false when exited the screen.
4)Use arrow keys to move the camera and make the sprite enter or exit the camera view.

Minimal reproduction project

TestVisibilityNotifierBug.zip

@KoBeWi
Copy link
Member

KoBeWi commented Feb 8, 2023

If you make your sprite invisible, it makes VisibleOnScreenNotifier2D invisible, which makes it never appear of screen (because it's invisible).
VisibleOnScreenNotifier2D in 4.0 is more performant and accurate, because it uses actual drawing code to determine whether it's visible, but as a result, the node has to be visible.

btw no need to toggle sprite's visibility. It will be culled automatically when off-screen.

@KoBeWi KoBeWi closed this as not planned Won't fix, can't repro, duplicate, stale Feb 8, 2023
@KoBeWi KoBeWi added archived and removed bug labels Feb 8, 2023
@takhimi
Copy link
Author

takhimi commented Feb 9, 2023

@KoBeWi If this is intended by design for v4 , sure fine. But please put into document this new behavior of this node since it does behave differently compared to v3.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants