Skip to content

Class

SmoothPlacementService

Generated GDScript class reference for GridPlacement.SmoothPlacementService.

Status
Current
Version
v6.2.1
Source updated
2026-09-24
Generated on
2026-10-22

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 RefCounted

Members

NameKindSummary
SERVICE_NAMEFieldTag on this service's player-facing issues; the messages themselves are shared on PlacementCommitAttempt.
occupied_maskPropertyPhysics 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_parentPropertyParent node for committed placements. Must be set before try_place().
occupancy_registryPropertyThe smooth occupancy projection. It is optional for preview-only use, but committed placement requires the shared world registry below.
world_registryPropertyShared world-scoped authority for committed 2D records. Required for every supported commit, move, and removal path.
lifecycle_allocatorPropertyPlugin-owned allocator for attempt/reservation IDs. Configured by the host; used to mint the stable [PlacementLifecycleResult.attempt_id].
world_idPropertyWorld and session identifiers surfaced on the canonical lifecycle result so backend consumers can correlate a commit without inspecting Godot nodes.
session_idProperty
configureMethod
get_last_reportMethod
create_preview_atMethod
move_preview_toMethod
rotate_previewMethod
validate_atMethod
try_placeMethod
attemptProperty
projection_errorProperty
reportProperty
rotProperty
nodeProperty
node2dProperty
authored_scaleProperty
authored_skewProperty
idProperty
fpProperty
world_rectProperty
world_recordProperty
lifecycleProperty
clear_previewMethod
get_previewMethod
has_previewMethod
unregister_placed_nodeMethod
update_placed_nodeMethod