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 PlacementSession.placement_coordinate_mode is 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 occupied_mask. The committed node is parented to 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 |
|---|---|---|
SERVICE_NAME | Field | Tag on this service's player-facing issues; the messages themselves are shared on PlacementCommitAttempt. |
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 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. |
lifecycle_allocator | Property | Plugin-owned allocator for attempt/reservation IDs. Configured by the host; used to mint the stable [PlacementLifecycleResult.attempt_id]. |
world_id | Property | World and session identifiers surfaced on the canonical lifecycle result so backend consumers can correlate a commit without inspecting Godot nodes. |
session_id | Property | |
configure | Method | |
get_last_report | Method | |
create_preview_at | Method | |
move_preview_to | Method | |
rotate_preview | Method | |
validate_at | Method | |
try_place | Method | |
attempt | Property | |
projection_error | Property | |
report | Property | |
rot | Property | |
node | Property | |
node2d | Property | |
authored_scale | Property | |
authored_skew | Property | |
id | Property | |
fp | Property | |
world_rect | Property | |
world_record | Property | |
lifecycle | Property | |
clear_preview | Method | |
get_preview | Method | |
has_preview | Method | |
unregister_placed_node | Method | |
update_placed_node | Method |