Smooth/free placement service for exact world-position placement. Provides preview, spatial-overlap validation, and commit at arbitrary [Vector2] world positions — the non-grid counterpart of [ObjectPlacementService]. Grid mode remains untouched; this service activates only when [member PlacementSession.placement_coordinate_mode] is [constant PlacementEnums.PlacementCoordinateMode.SMOOTH]. Validation uses [Area2D] + [CollisionShape2D] overlap queries against the scene's physics layer, not cell identity. The caller configures which collision layers count as "occupied" via [member occupied_mask]. The committed node is parented to [member objects_parent] at the exact world position. No cell snapping, no TileMapLayer mutation.
Source: addons/grid_placement/services/smooth_placement_service.gd
Syntax
class SmoothPlacementService extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
occupied_mask | Property | Physics collision mask for overlap queries. Only bodies/areas on these layers count as obstacles. Default: 0 (disabled). The registry is the primary authority; physics is an optional secondary layer. Set to a positive layer mask to enable physics validation. |
objects_parent | Property | Parent node for committed placements. Must be set before [method try_place]. |
occupancy_registry | Property | The smooth occupancy projection. It is optional for preview-only use, but committed placement requires the shared world registry below. |
world_registry | Property | Shared world-scoped authority for committed 2D records. Required for every supported commit, move, and removal path. |
configure | Method | |
get_last_report | Method | |
create_preview_at | Method | |
move_preview_to | Method | |
rotate_preview | Method | |
validate_at | Method | |
try_place | Method | |
clear_preview | Method | |
get_preview | Method | |
has_preview | Method | |
unregister_placed_node | Method | |
update_placed_node | Method |