This guide covers the Grid Placement-specific parts of web export.
Version note: This guide is for Grid Placement 6.0.0 on Godot 4.5.0 through 4.7. Grid Placement is a GDScript addon; no .NET/Mono setup is required for the plugin path described here.
Main Web Export Rule
Save runtime resources as external .tres files whenever possible.
Avoid relying on embedded SubResource(...) entries for important placement resources. Web exports are less forgiving when nested resources or typed resource arrays fail to deserialize the same way they did in the editor.
Good candidates for external .tres files:
GridPlacementBundleGridPlacementSettings- placement rules
- collision rule settings/messages
- fail visual settings
- placement profiles
- terrain palettes/entries
ScenePlacementEntryresources
External Resource Example
Avoid this pattern for important runtime rule resources:
# Avoid: embedded subresource
[sub_resource type="Resource" id="Resource_abc"]
script = ExtResource("collisions_script")
[resource]
placement_rules = [SubResource("Resource_abc")]
Prefer this pattern:
# Prefer: external rule resource
[ext_resource type="Resource" path="res://rules/my_collision_rule.tres" id="1_rule"]
[resource]
placement_rules = [ExtResource("1_rule")]
This makes the dependency obvious and easier to include in exports.
Export Filter
Make sure the web export includes the plugin, templates, scenes, rules, config, and any custom resource folders your placement setup uses.
Common paths to include:
res://addons/grid_placement/res://templates/or your copiedgrid_placement_templatespath- your
res://config/folder - your
res://rules/folder - your placeable scenes/resources folder
- your terrain palette/resources folder
If you use a restrictive export filter, missing .tres or .tscn files are a common cause of web-only failures.
Pre-Export Checklist
- The plugin is enabled before exporting.
- Default input actions exist in the project Input Map.
-
GridPlacementBundleis included in the export. -
GridPlacementBundle.settingspoints to an externalGridPlacementSettingsresource. - Base rules in
PlacementSettings.placement_rulesare external.tresfiles. - Placeable entries reference real
.tscnfiles. - Placement profiles and local rules are included in the export.
- Collision rule settings/messages are serialized or safely initialized.
- Indicator scenes serialize
collide_with_areas/collide_with_bodiesas needed. - Collision masks match your project's physics layers.
- UI controls use correct Mouse Filter settings so they do not block placement input unexpectedly.
Rule and Indicator Checks
Rules load but every placement succeeds
Check:
- The rule resource is actually included in the export.
- The
placement_rulesarray is not empty at runtime. - The placeable scene has collision shapes if tile-based rules need indicators.
CollisionsCheckRulelooks at the same layer the target objects are on.- Indicator scenes have the collision flags needed for your target object type.
Indicators do not appear
Check:
- The indicator scene/template is included in the export.
- The placeable scene has a collision footprint.
- The rule setup did not report missing
target_map, owner, logger, or settings. - Browser console/network output does not show missing resources.
Terrain preview does not appear
Check:
- A
TerrainPreviewnode exists in the same injected scene scope. - The selected terrain can be resolved against the target map's
TileSet. - The terrain palette/entry resources are included in the export.
- The target
TileMapLayeris assigned throughPlacementLevelContext.target_map.
Array Syntax
Plain arrays are easiest to inspect and are usually the safest format for resource lists:
placement_rules = [ExtResource("1_rule")]
If a typed resource array behaves differently in a web build than in the editor, try saving the resource with plain array syntax or recreating the resource in the editor so Godot rewrites it cleanly.
Testing Before Release
Do not wait until the store build to test web export.
Recommended process:
- Export a minimal web build with one placeable and one rule.
- Test object placement.
- Test manipulation if your game uses it.
- Test terrain painting if your game uses it.
- Open browser console/network output and look for missing resources.
- Only then add the full UI/catalog/content set.
For repo-level validation, run the relevant Godot/GdUnit tests from the repo root with the Godot project path set to godot.
godot --headless --path godot -s addons/gdUnit4/bin/GdUnitCmdTool.gd runtest -a res://test/grid_placement
Troubleshooting Quick Reference
| Symptom | First things to check |
|---|---|
| Works in editor, fails on web | Missing exported resources or embedded subresources. |
| Rules missing | placement_rules resources not included/exported. |
| Every tile is green | Collision masks/layers or missing collision shapes. |
| No terrain preview | Missing TerrainPreview, missing terrain resources, or missing target map. |
| Clicks do nothing | Input actions missing or UI controls consuming mouse input. |
| Browser console shows 404/missing resource | Export filter did not include the needed folder/file. |
Related Guides
Source
docs/v6-0/guides/web-export.md
Plugin docs root:gdscript/plugins/grid_placement_dev/docs