Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

Layer-Namer

An asset by WilliamGDev
The page banner background of a mountain and forest
Layer-Namer hero image

Quick Information

0 ratings
Layer-Namer icon image
WilliamGDev
Layer-Namer

A Godot 4 plugin to name your collision and render layers, inspired by Unity's layer system.

Supported Engine Version
4.5
Version String
1.0.0
License Version
MIT
Support Level
community
Modified Date
6 hours ago
Git URL
Issue URL

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

  1. Download or clone this repository
  2. Copy the addons/layer_namer folder into your project's addons/ folder
  3. Go to Project → Project Settings → Plugins
  4. 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

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Layer-Namer icon image
WilliamGDev
Layer-Namer

A Godot 4 plugin to name your collision and render layers, inspired by Unity's layer system.

Supported Engine Version
4.5
Version String
1.0.0
License Version
MIT
Support Level
community
Modified Date
6 hours ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers