Skip to content

Class

SmoothPlacementService

Generated GDScript class reference for GridPlacement.SmoothPlacementService.

Status
Current
Version
v6.0
Source updated
Active v6.0 guide line from Grid Placement repo
Generated on
2026-09-01

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 RefCounted

Members

NameKindSummary
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 [method 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
lifecycleProperty
clear_previewMethod
get_previewMethod
has_previewMethod
unregister_placed_nodeMethod
update_placed_nodeMethod