Skip to content

PlaceableInstance

DEPRECATED: This component is deprecated and will be removed in a future version.

Use GBPlacementPersistence utility class instead for placement tracking. The new approach uses lightweight metadata instead of adding extra nodes to the scene tree.

Migration Guide:

  • Replace PlaceableInstance.new() + add_child() with GBPlacementPersistence.mark_as_placed() - Replace placed.save() with GBPlacementPersistence.save_placement_data() - Replace PlaceableInstance.instance_from_save() with GBPlacementPersistence.instance_from_save() - For batch operations use GBPlacementPersistence.save_all_placements() and load_all_placements()

DEPRECATED: This component is deprecated and should not be used in new projects.

Use GBPlacementPersistence utility class instead for metadata-based placement tracking.

The new approach is lighter weight (no extra nodes), more transparent, and easier to use.

See: addons/grid_building/utils/gb_placement_persistence.gd

Component to attach to objects that are placed by the building system by remembering the placeable resource that they were instanced from

const default_name = “PlaceableInstance”
const group_name = “PlaceableInstance”
signal placeable_path_changed( placeable_path: String )
placeable: Placeable
func _init( p_placeable_path: String ) -> void
func resolve_gb_dependencies( p_container: GBCompositionContainer ) -> void
func validate_setup( ) -> bool
func save( p_include_uid: bool ) -> Dictionary

Saves the location and reference to placeable reference so a new instance of the object can be created on load

Only provides enough data for the PackedScene to be instance but does not by itself remember the full state of the scene object

static func instance_from_save( p_save: Dictionary, p_instance_parent: Node ) -> Node

Instances a new copy of the saved PlaceableInstance placeable’s packed_scene

This only recreates the object as the PackedScene in the Placeable resource dictates plus adding a new PlaceableInstance node.

If you want other data to persist, you will need to create your one save methods

addons/grid_building/components/placeable_instance.gd


This API reference is automatically generated from the plugin source code. For implementation examples and usage guides, see the guides section.