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
Godot already provides 32 collision layers, but managing them across large projects quickly becomes error-prone.A simple editor plugin for Godot 4 that turns manual collision layer and mask setup into reusable named presets. Instead of remembering bitmask integers or ticking boxes on every physics object, you define named presets (like “Player”, “Enemy”, “Trigger”) once and apply them with a single click in the editor. The plugin also generates safe constants for use in code and keeps assigned presets in sync at runtime.The plugin features:- A clean preset UI integrated into the CollisionObject inspector.- Central preset database stored in a resource, ready for version control.- Automatically generated CollisionPresets constants for autocomplete.- Runtime sync via an autoload so presets are applied when the scene runs.- Metadata-based storage so scene inheritance and version control work naturally.Lookup the GitHub readme for examples and documentation.https://github.com/Adrien-Lucas/godot-collision-presetsWorks with both 2D and 3D physics objects.
Godot Collision Presets
Turn messy fiddling with collision layers and masks into presets that you can easily apply to your nodes.
Overview
Godot already provides 32 collision layers, but managing them across large projects quickly becomes error-prone.
Collision Presets is a Godot 4 editor plugin designed to simplify physics management in 2D or 3D projects. Instead of manually memorizing bitmask integers or ticking boxes for every CollisionObject3D, you can define named presets (e.g., "Player", "Enemy", "Trigger") and apply them with a single click. The plugin keeps layers and masks in sync at runtime and exposes a small, clean API for code usage.
| BEFORE | AFTER |
|---|---|
|
|
|
Minimal Examples
Once a preset is defined in the editor, you can apply it in your scripts using the generated constants:
# Setting a node's preset is supported in @tool mode. Uncomment to try it out!
# @tool
extends CharacterBody3D
func _ready():
# Automatically apply the "Player" preset
CollisionPresetsAPI.set_node_preset(self, CollisionPresets.Player)
Or check a preset's mask value for raycasting:
var query := PhysicsRayQueryParameters3D.create(from, to)
var collision_preset_list = [CollisionPresets.WorldStatic, CollisionPresets.Player]
for preset_name in collision_preset_list:
var preset_layer = CollisionPresetsAPI.get_preset_layer(preset_name)
query.collision_mask |= preset_layer # Combine multiple layer bitmasks
var result := space_state.intersect_ray(query)
Features
- Inspector Integration: A custom UI appears directly in the
CollisionObjectinspector. - Default Collision Preset: Define a project-wide default preset automatically applied to any CollisionObject without a preset.
- Metadata Based: The selected preset is stored in the node’s metadata. This makes it source control friendly and fully compatible with scene inheritance.
- Centralized Database: All collision presets are saved automatically in a single
.tresresource. - Type-Safe Constants: Automatically generates a
CollisionPresetsclass with constants for all your preset names, enabling autocomplete and preventing typos. - Runtime Sync: An autoload ensures that any node with a preset assigned in the editor gets the correct layer and mask values when the game starts.
- ID-Based Robustness: Presets use unique IDs internally, so renaming a preset won't break your existing node assignments.
Short Documentation
API Reference (CollisionPresetsAPI)
get_preset_layer(name)/get_preset_mask(name): Retrieves the raw integer values for a specific preset.set_node_preset(node, preset_name): Sets a preset and updates the node's metadata (safe for@toolscripts).get_node_preset(node): Returns the name of the preset currently assigned to a node.
Generated Constants (CollisionPresets)
The plugin generates a script at res://addons/collision_presets/preset_names.gd containing:
CollisionPresets.YOUR_PRESET_NAME: A string constant for each preset.CollisionPresets.all(): Returns aPackedStringArrayof all available preset names.
Installation
- Download or clone this repository into your project's
addons/folder. - Go to Project Settings > Plugins and enable Collision Presets.
- The plugin will automatically:
- Create a
presets.tresfile in the plugin folder. - Register a
CollisionPresetRuntimeautoload. - Generate the
CollisionPresetsconstants script.
- Create a
- Select any
CollisionObject(StaticBody, CharacterBody, etc.) and look for the Preset dropdown in the Inspector.
AI Disclaimer
This plugin was mainly vibe-coded using Junie by JetBrain. It was then cleaned and refined by hand to reach release quality.
Godot already provides 32 collision layers, but managing them across large projects quickly becomes error-prone.
A simple editor plugin for Godot 4 that turns manual collision layer and mask setup into reusable named presets.
Instead of remembering bitmask integers or ticking boxes on every physics object, you define named presets (like “Player”, “Enemy”, “Trigger”) once and apply them with a single click in the editor. The plugin also generates safe constants for use in code and keeps assigned presets in sync at runtime.
The plugin features:
- A clean preset UI integrated into the CollisionObject inspector.
- Central preset database stored in a resource, ready for version control.
- Automatically generated CollisionPresets constants for autocomplete.
- Runtime sync via an autoload so presets are applied when the scene runs.
- Metadata-based storage so scene inheritance and version control work naturally.
Lookup the GitHub readme for examples and documentation.
https://github.com/Adrien-Lucas/godot-collision-presets
Works with both 2D and 3D physics objects.
Reviews
Quick Information
Godot already provides 32 collision layers, but managing them across large projects quickly becomes error-prone.A simple editor plugin for Godot 4 that turns manual collision layer and mask setup into reusable named presets. Instead of remembering bitmask integers or ticking boxes on every physics object, you define named presets (like “Player”, “Enemy”, “Trigger”) once and apply them with a single click in the editor. The plugin also generates safe constants for use in code and keeps assigned presets in sync at runtime.The plugin features:- A clean preset UI integrated into the CollisionObject inspector.- Central preset database stored in a resource, ready for version control.- Automatically generated CollisionPresets constants for autocomplete.- Runtime sync via an autoload so presets are applied when the scene runs.- Metadata-based storage so scene inheritance and version control work naturally.Lookup the GitHub readme for examples and documentation.https://github.com/Adrien-Lucas/godot-collision-presetsWorks with both 2D and 3D physics objects.