Install Asset
Install via Godot
To maintain one source of truth, Godot Asset Library is just a mirror of the old asset library so you can download directly on Godot via the integrated asset library browser
Quick Information
A Godot 4 plugin to name your collision and render layers, inspired by Unity's layer system.
Godot Layer Namer
A Godot 4 plugin that lets you name your collision and render layers, inspired by Unity's layer system. Instead of remembering which number corresponds to which layer, just use names directly in your code.
The Problem
In Godot, layers are just numbers: collision_mask = 4 # What is layer 4 again...?
The Solution
With Layer Namer you can do this: collision_mask = LayerNames.get_mask("Enemies")
Features
- Name up to 32 layers from the editor panel
- Names persist across sessions
- Access layers by name in any script via the LayerNames autoload
- Lightweight, no dependencies
Installation
- Download or clone this repository
- Copy the
addons/layer_namerfolder into your project'saddons/folder - Go to
Project → Project Settings → Plugins - Enable Layer Namer
Usage
Naming your layers
After enabling the plugin, open the Layer Namer panel in the bottom-right dock and assign names to your layers.
Using layer names in code
# Get the layer number by name
var layer = LayerNames.get_layer("Enemies") # returns 1, 2, 3...
# Get the bitmask directly for collision_mask
collision_mask = LayerNames.get_mask("Enemies")
# Get the name of a layer by its number
var name = LayerNames.get_layer_name(1)
Compatibility
- Godot 4.x
- GDScript
License
MIT License
A Godot 4 plugin to name your collision and render layers, inspired by Unity's layer system.
Reviews
Quick Information
A Godot 4 plugin to name your collision and render layers, inspired by Unity's layer system.