Edit of asset "TileMapCollisionManager" Accepted
| Old/Current | New/Edit | |
|---|---|---|
| Title | TileMapCollisionManager | TileMapCollisionManager |
| Description |
Name-based collision layer management for TileMap in Godot 4.x. TileMap.set_layer_enabled() takes a layer index — a raw integer. Your layers have names. Every time you restructure your TileMap, those indices shift silently and your collision code breaks with no error messages. You are manually maintaining a number-to-name mapping in your head. This script builds a name-to-index cache at startup and exposes a clean string-based API. Write set_collision_enabled_by_name("Ground", true) instead of set_layer_enabled(2, true). Your code survives TileMap restructuring because it never references indices directly. Features: - Name-to-index cache built automatically on ready - set_collision_enabled_by_name() for single layer control - refresh_layer_cache() to rebuild after runtime structural changes - Inspector-configured initial collision state on scene load - Duplicate layer name detection with warnings - Debug layer map printing via Inspector toggle - Zero dependencies — works in a blank project Attach TileMapCollisionManager.gd to your TileMap node. It replaces TileMap as the base class. Set initial_enabled_layers in the Inspector. Done. Godot 4.x only. GDScript 2.0. Extended version with batch methods, global toggles, and state snapshot serialization available at nullstateassets.itch.io. |
Name-based collision layer management for TileMap in Godot 4.x. TileMap.set_layer_enabled() takes a layer index — a raw integer. Your layers have names. Every time you restructure your TileMap, those indices shift silently and your collision code breaks with no error messages. You are manually maintaining a number-to-name mapping in your head. This script builds a name-to-index cache at startup and exposes a clean string-based API. Write set_collision_enabled_by_name("Ground", true) instead of set_layer_enabled(2, true). Your code survives TileMap restructuring because it never references indices directly. Features: - Name-to-index cache built automatically on ready - set_collision_enabled_by_name() for single layer control - refresh_layer_cache() to rebuild after runtime structural changes - Inspector-configured initial collision state on scene load - Duplicate layer name detection with warnings - Debug layer map printing via Inspector toggle - Zero dependencies — works in a blank project Attach TileMapCollisionManager.gd to your TileMap node. It replaces TileMap as the base class. Set initial_enabled_layers in the Inspector. Done. Godot 4.x only. GDScript 2.0. Extended version with batch methods, global toggles, and state snapshot serialization available at nullstateassets.itch.io. |
| Category | Scripts | Scripts |
| License | MIT | MIT |
| Repository Provider | GitHub | GitHub |
| Repository Url | https://github.com/NullState-Assets/TileMapCollisionManager | https://github.com/NullState-Assets/TileMapCollisionManager |
| Issues Url | https://github.com/NullState-Assets/TileMapCollisionManager/issues | https://github.com/NullState-Assets/TileMapCollisionManager/issues |
| Godot version | Godot 4.0 | Godot 4.0 |
| Version String | 1.0 | 1.0 |
| Download Commit | 3cc123d88a46d14bde708a41eb863799b6569648 | 3cc123d88a46d14bde708a41eb863799b6569648 |
| Download Url (Computed) | https://github.com/NullState-Assets/TileMapCollisionManager/archive/3cc123d88a46d14bde708a41eb863799b6569648.zip | https://github.com/NullState-Assets/TileMapCollisionManager/archive/3cc123d88a46d14bde708a41eb863799b6569648.zip |
| Icon Url |
https://raw.githubusercontent.com/NullState-Assets/TileMapCollisionManager/main/tilemapcollisionmanagericon.png
|
https://raw.githubusercontent.com/NullState-Assets/TileMapCollisionManager/main/tilemapcollisionmanagericon.png
|