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

Allow TileMap physics/navigation to still work when hidden #83560

Merged

Conversation

groud
Copy link
Member

@groud groud commented Oct 18, 2023

Fixes #83499

@ChloePrime
Copy link

ChloePrime commented Oct 19, 2023

Should we apply this to navigation too?

@groud
Copy link
Member Author

groud commented Oct 19, 2023

Should we apply this to navigation too?

I don't know. I didn't check if navigation nodes were disabled when hidden.
But it should be easy to implement too.

@KoBeWi
Copy link
Member

KoBeWi commented Oct 19, 2023

It has the same condition, so likely should be changed too:

bool forced_cleanup = in_destructor || !enabled || !navigation_enabled || !tile_map_node->is_inside_tree() || !tile_set.is_valid() || !tile_map_node->is_visible_in_tree();

@groud
Copy link
Member Author

groud commented Oct 19, 2023

It has the same condition, so likely should be changed too:

Yeah, I know it has the same condition. My question is whether or not other navigation nodes (mainly NavigationRegion2D) are still working when hidden or not.

@akien-mga akien-mga requested a review from smix8 October 26, 2023 12:41
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine, just waiting to see if this should be done for navigation too.

@AThousandShips
Copy link
Member

Can't find anything in the NavigationRegion2D code that is controlled by visibility in the tree, but haven't tested the behavior

@groud groud force-pushed the allow_physics_for_hidden_tilemap branch from 1cb1698 to 9d90f17 Compare October 26, 2023 14:55
@groud groud changed the title Allow TileMap physics to still work when hidden Allow TileMap physics/navigation to still work when hidden Oct 26, 2023
@groud
Copy link
Member Author

groud commented Oct 26, 2023

Done, I've just pushed an update to make navigation work too.

@smix8
Copy link
Contributor

smix8 commented Oct 26, 2023

Yes navigation still works when not visible. Visibility has no use in navigation apart from debug rendering. Most navigation related nodes have a dedicated enabled property to enable/disable them.

As mentioned in dev chat I also wonder why it should be even any other way, visibility has clearly to do with visible things, aka rendering / occlusion. It has no bearing on logic and imo should not.

@akien-mga akien-mga merged commit d3fb6c1 into godotengine:master Oct 27, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

Tilemap collision is disabled when not visible
6 participants