Implement disable_mode property for TileMapLayer physics #13540
soap-cheese
started this conversation in
2D
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently the
CollisionObject2Dclass has the propertydisable_mode, which determines its behavior in physics whenprocess_modeis set to...DISABLED(or to...INHERITand the parent node is disabled). By default, the object is removed from the physics simulation.TileMapLayercan be a part of the physics simulation as well, via physics layers of its TileSet. However, sinceTileMapLayerdoesn't inherit fromCollisionObject2D, it does not havedisable_modeproperty, or (as far as I'm aware) any reasonable alternatives to it. Default behavior is to not remove the TileMapLayer node from the physics simulation when its processing is disabled. It causes collisions regardless of whether it can process or not.This is inconsistent with existing logic, and also makes it impossible to effectively disable large scenes at once by disabling processing of the root node, which seems like the whole point of
Node.PROCESS_MODE_INHERIToption in the first place.I suggest it would make sense to add
disable_modeproperty either toTileMapLayer,TileSetor individual physics layer of aTileSet, with the same functionality as in theCollisionObject2Dclass. It would be set to "remove from simulation when disabled" option by default, and could be set to "make static" or "keep active", the same way it works with CollisionObject2D.Beta Was this translation helpful? Give feedback.
All reactions