Grid Placement System
Core System
PlacementSystemComponent

PlacementSystemComponent

The PlacementSystemComponent is the core orchestrator of the Grid Placement System plugin. It provides a comprehensive grid-based object placement system with precision controls, multiple surface types, audio feedback, and intuitive interaction methods.

Overview

This component should be added to your Player Pawn to enable grid-based placement functionality. It manages camera controls, input handling, object validation, surface detection, visual feedback, and audio cues during placement mode.

Quick Setup

Add the PlacementSystemComponent to your Player Pawn - all assets and input mappings are auto-loaded from the plugin content.

Configuration Categories

Core Settings

Controls fundamental behavior of the placement system.

Core Settings Configuration
PropertyTypeDefaultDescription
Auto Exit After PlacementBooleanfalseAutomatically exit placement mode after placing an object
Auto Create GridsBooleantrueAutomatically detect and create grids on tagged surfaces when entering placement mode
Default Object To PlaceActor ClassNoneObject class to select automatically when entering placement mode

Audio

Grid Settings Configuration

Configure audio feedback for placement actions.

PropertyTypeDefaultDescription
Sounds EnabledBooleantrueEnable/disable all placement audio feedback
Master Sound VolumeFloat1.0Global volume multiplier for all placement sounds
Snap SoundSound BaseAuto-loadedSound played when objects snap to grid
Place SoundSound BaseAuto-loadedSound played when objects are placed
Rotate SoundSound BaseAuto-loadedSound played when objects are rotated

Grid Settings

Grid Settings Configuration

Configure the visual grid system and surface detection.

PropertyTypeDefaultDescription
Placement Type TagsMapFloor: "Floor"
Wall: "Wall"
Roof: "Roof"
Tags used to identify different surface types in your level
Grid SizeFloat25.0Size of each grid cell in Unreal units (25 = 25cm)
Grid ColorLinear ColorWhitePrimary color of the grid lines
Sub Grid ColorLinear ColorWhiteColor of sub-division grid lines
Grid PatternTexture2DNoneOptional texture pattern for the grid overlay

Materials

Materials Configuration

Visual materials used by the placement system (auto-loaded from plugin content).

PropertyTypeDefaultDescription
Grid MaterialMaterial InterfaceAuto-loadedMaterial applied to surfaces to show the grid
Selected Outline MaterialMaterial InterfaceAuto-loadedOutline material for selected/preview objects
Overlay MaterialMaterial InterfaceAuto-loadedMaterial for the placement indicator overlay

Object Editing

Object Editing Configuration

Settings for editing already-placed objects.

PropertyTypeDefaultDescription
Allow Object SelectionBooleantrueEnable clicking on placed objects to select them for editing
Allow Object DeletionBooleantrueAllow deleting selected objects with the delete key

Controls

Controls Configuration

Camera and movement configuration.

PropertyTypeDefaultDescription
Camera Movement SpeedFloat800.0Speed of camera movement during placement
Zoom SpeedFloat100.0Speed of camera zoom in/out
Min Zoom DistanceFloat200.0Minimum camera distance from target
Max Zoom DistanceFloat1700.0Maximum camera distance from target
Object Rotation IncrementFloat45.0Degrees to rotate objects per input (45° = 8 directions)

Precision Placement

Precision Placement Configuration

Fine-tuned placement controls.

PropertyTypeDefaultDescription
Allow Precision PlacementBooleantrueEnable precision mode when holding Shift
Show Precision Mode IndicatorBooleanfalseHide/Unhide Overlay when in Precision Mode
If you set Show Precision Mode Indicator to false, the Precision Overlay will be hidden.

Visuals

Visual feedback and indicators

Visual feedback and indicators.

PropertyTypeDefaultDescription
Show Placement OverlayBooleantrueShow the placement indicator overlay
Valid Placement ColorLinear ColorGreenColor when placement location is valid
Invalid Placement ColorLinear ColorRedColor when placement location is blocked
Precision Mode ColorLinear ColorWhiteColor when in precision placement mode

Camera Settings

Camera Settings Configuration

Camera behavior during placement mode (supports both Third-Person and First-Person setups).

PropertyTypeDefaultDescription
Disable Collision In Placement ModeBooleantrueDisable camera collision while placing objects
Enable Camera Pitch ConstraintBooleantrueLimit camera pitch to prevent flipping
Min Camera PitchFloat-60.0Minimum camera pitch angle (degrees)
Max Camera PitchFloat0.0Maximum camera pitch angle (degrees)
Vertical Min Offset ZFloat0.0Minimum vertical camera offset
Vertical Max Offset ZFloat200.0Maximum vertical camera offset

Input Settings

Input Settings Configuration

Input mapping contexts and actions (auto-loaded from plugin content).

PropertyTypeDescription
Placement Mapping ContextInput Mapping ContextContext active during placement mode
Toggle Mapping ContextInput Mapping ContextContext for toggling placement mode
IA_Placement ToggleInput ActionToggle placement mode on/off
IA_Placement ConfirmInput ActionConfirm object placement
IA_Placement CancelInput ActionCancel placement or exit mode
IA_Placement RotateInput ActionRotate preview object
IA_Placement ZoomInput ActionZoom camera in/out
IA_Placement MoveInput ActionMove camera
IA_Placement ShiftInput ActionHold for precision mode
IA_Select ObjectInput ActionSelect placed objects for editing
IA_Delete ObjectInput ActionDelete selected objects
IA_Placement VerticalInput ActionMove camera vertically

Debug Settings

Debug Settings Configuration

Development and debugging tools.

PropertyTypeDefaultDescription
Show Debug InfoBooleanfalseDisplay debug information on screen

Blueprint API

Core Functions

Note: You don't need to use this API unless necessary
PlacementHelper already handles system initialization internally.

Initialize()

UFUNCTION(BlueprintCallable, Category = "GPS: Placement System")
void Initialize();

Initializes the placement system. Call this in your Pawn's BeginPlay event.

StoreInitialCameraState()

UFUNCTION(BlueprintCallable, Category = "GPS: Placement System")
void StoreInitialCameraState();

Stores the initial camera state to restore later when exiting placement mode.

EnterPlacementMode()

UFUNCTION(BlueprintCallable, Category = "GPS: Placement System")
bool EnterPlacementMode();

Enters placement mode. Returns true if successful.

ExitPlacementMode()

UFUNCTION(BlueprintCallable, Category = "GPS: Placement System")
void ExitPlacementMode();

Exits placement mode and returns to normal game mode.

SelectObjectToPlace(ObjectClass)

UFUNCTION(BlueprintCallable, Category = "GPS: Placement System")
bool SelectObjectToPlace(TSubclassOf<AActor> ObjectClass);

Selects an object class for placement. Must be in placement mode first.

ClearSelectedObject()

UFUNCTION(BlueprintCallable, Category = "GPS: Placement System")
void ClearSelectedObject();

Clears the currently selected object for placement.

RefreshGrids()

UFUNCTION(BlueprintCallable, Category = "GPS: Placement System")
void RefreshGrids();

Refreshes the grid system, useful when surfaces are added/removed at runtime.

Object Editing

SelectPlacedObjectForEditing(Actor)

UFUNCTION(BlueprintCallable, Category = "GPS: Object Editing")
void SelectPlacedObjectForEditing(AActor* Actor);

Selects a placed object for editing (moving, rotating, deleting).

DeleteSelectedPlacedObject()

UFUNCTION(BlueprintCallable, Category = "GPS: Object Editing")
void DeleteSelectedPlacedObject();

Deletes the currently selected placed object.

State Getters

GetCurrentMode()

UFUNCTION(BlueprintCallable, BlueprintPure, Category = "GPS: Placement System")
EPlacementMode GetCurrentMode() const;

Returns the current mode: Normal or Placement.

HasSelectedObject()

UFUNCTION(BlueprintCallable, BlueprintPure, Category = "GPS: Placement System")
bool HasSelectedObject() const;

Returns true if an object is selected for placement.

GetCurrentPlacementValidity()

UFUNCTION(BlueprintCallable, BlueprintPure, Category = "GPS: Placement System")
EPlacementValidity GetCurrentPlacementValidity() const;

Returns the current placement validity: Valid, Invalid, or Unknown.

IsInPrecisionMode()

UFUNCTION(BlueprintCallable, BlueprintPure, Category = "GPS: Precision Placement")
bool IsInPrecisionMode() const;

Returns true if precision placement mode is active (Shift held + precision enabled).

Events

Core Placement Events

OnPlacementModeChanged

UPROPERTY(BlueprintAssignable, Category = "GPS: Events")
FOnPlacementModeChanged OnPlacementModeChanged;

Fired when entering or exiting placement mode. Parameters: NewMode (EPlacementMode)

OnObjectPlaced

UPROPERTY(BlueprintAssignable, Category = "GPS: Events")
FOnObjectPlaced OnObjectPlaced;

Fired when a new object is successfully placed. Parameters: PlacedObject (AActor*), WorldLocation (FVector)

OnPlacementValidityChanged

UPROPERTY(BlueprintAssignable, Category = "GPS: Events")
FOnPlacementValidityChanged OnPlacementValidityChanged;

Fired when placement validity changes (valid/invalid/unknown). Parameters: NewValidity (EPlacementValidity)

OnNeedObjectSelection

UPROPERTY(BlueprintAssignable, Category = "GPS: Events")
FOnNeedObjectSelection OnNeedObjectSelection;

Fired when the system needs an object to be selected for placement.

Object Management Events

OnPlacedObjectSelected

UPROPERTY(BlueprintAssignable, Category = "GPS: Events")
FOnPlacedObjectSelected OnPlacedObjectSelected;

Fired when a placed object is selected for editing. Parameters: SelectedObject (AActor*)

OnPlacedObjectDeselected

UPROPERTY(BlueprintAssignable, Category = "GPS: Events")
FOnPlacedObjectDeselected OnPlacedObjectDeselected;

Fired when a placed object is deselected. Parameters: DeselectedObject (AActor*)

OnPlacedObjectMoved

UPROPERTY(BlueprintAssignable, Category = "GPS: Events")
FOnPlacedObjectMoved OnPlacedObjectMoved;

Fired when a placed object is moved to a new location. Parameters: MovedObject (AActor*), NewLocation (FVector)

OnPlacedObjectDeleted

UPROPERTY(BlueprintAssignable, Category = "GPS: Events")
FOnPlacedObjectDeleted OnPlacedObjectDeleted;

Fired when a placed object is deleted. Parameters: DeletedObject (AActor*)

Tracking and Preview Events

OnObjectClassSelectedForPlacement

UPROPERTY(BlueprintAssignable, Category = "GPS: Events")
FOnObjectClassSelectedForPlacement OnObjectClassSelectedForPlacement;

Fired when an object class is selected for placement. Parameters: ObjectClass (TSubclassOf<AActor>), PlacementType (EPlacementType)

OnObjectPreviewStarted

UPROPERTY(BlueprintAssignable, Category = "GPS: Events")
FOnObjectPreviewStarted OnObjectPreviewStarted;

Fired when object preview begins (either for new placement or editing). Parameters: PreviewActor (AActor*), ObjectClass (TSubclassOf<AActor>), bIsEditing (bool)

OnObjectPreviewEnded

UPROPERTY(BlueprintAssignable, Category = "GPS: Events")
FOnObjectPreviewEnded OnObjectPreviewEnded;

Fired when object preview ends. Parameters: PreviewActor (AActor*)

OnObjectPreviewMoved

UPROPERTY(BlueprintAssignable, Category = "GPS: Events")
FOnObjectPreviewMoved OnObjectPreviewMoved;

Fired when the preview object is moved. Parameters: PreviewActor (AActor*), NewLocation (FVector), NewRotation (FRotator)

OnObjectRotated

UPROPERTY(BlueprintAssignable, Category = "GPS: Events")
FOnObjectRotated OnObjectRotated;

Fired when an object is rotated during placement. Parameters: PreviewActor (AActor*), OldRotation (float), NewRotation (float)

State Change Events

OnPlacementTypeChanged

UPROPERTY(BlueprintAssignable, Category = "GPS: Events")
FOnPlacementTypeChanged OnPlacementTypeChanged;

Fired when switching between Floor/Wall/Roof placement. Parameters: OldType (EPlacementType), NewType (EPlacementType)

OnPrecisionModeChanged

UPROPERTY(BlueprintAssignable, Category = "GPS: Events")
FOnPrecisionModeChanged OnPrecisionModeChanged;

Fired when entering or exiting precision mode. Parameters: bPrecisionModeActive (bool)

OnValidationChangedWithContext

UPROPERTY(BlueprintAssignable, Category = "GPS: Events")
FOnValidationChangedWithContext OnValidationChangedWithContext;

Enhanced validation event with additional context. Parameters: PreviewActor (AActor*), NewValidity (EPlacementValidity), PlacementType (EPlacementType), bPrecisionMode (bool)

OnInputModeChanged

UPROPERTY(BlueprintAssignable, Category = "GPS: Events")
FOnInputModeChanged OnInputModeChanged;

Fired when input mode state changes. Parameters: bPlacementInputActive (bool), bToggleInputActive (bool)

Surface Setup

To use the placement system, you need to tag your level geometry:

  1. Floor Surfaces: Add the tag Floor to static mesh actors that should accept floor-placed objects
  2. Wall Surfaces: Add the tag Wall to vertical static mesh actors for wall-mounted objects
  3. Roof Surfaces: Add the tag Roof to ceiling/overhead static mesh actors

The system will automatically detect these tagged surfaces and show appropriate grids based on the selected object's placement type.

Default Input Controls

Camera Controls

InputAction
WASDCamera Movement
Mouse ScrollZoom In/Out
E/QUp/Down Movement

Object Placement

InputAction
Left ClickPlace Object
Right ClickRotate Object
X/ESCCancel Placing/Editing Object
DeleteDelete Object While Selected
Middle MouseSelect Object for Editing

Special Modes

InputAction
Hold ShiftPrecision Mode (bypasses grid snapping)
TabToggle Enter/Exit Placement Mode

Camera System Features

Automatic Camera Setup Detection

  • Third-Person Projects: Uses existing SpringArm component
  • First-Person Projects: Automatically creates temporary SpringArm for placement mode
  • Seamlessly restores original camera setup when exiting placement mode

Camera Constraints

  • Configurable pitch limits to prevent camera flipping
  • Collision detection can be disabled during placement
  • Vertical movement constraints with customizable limits

Performance Considerations

  • Grid Management: Grids are only shown for the current placement type
  • Collision Optimization: Uses oriented bounding box collision for accurate placement validation
  • Audio Throttling: Snap sounds have cooldown to prevent audio spam
  • Component Architecture: Modular design with dedicated managers for different systems

Audio Feedback System

The system provides audio feedback for key actions:

  • Snap Sound: Plays when objects snap to grid positions (with cooldown)
  • Place Sound: Plays when objects are successfully placed
  • Rotate Sound: Plays when objects are rotated

All sounds respect the master volume setting and can be globally disabled.

Troubleshooting

Objects won't place

  • Ensure surfaces are tagged correctly (Floor, Wall, Roof)
  • Check that placement location isn't occupied by other objects
  • Verify the object implements IPlaceableObjectInterface
  • Enable debug info to see collision detection visualization

Camera behaves strangely

  • The system automatically detects and handles both TPP and FPP setups
  • For FPP projects, a temporary SpringArm is created during placement mode
  • Check camera pitch constraints if movement feels limited
  • Verify SpringArm component exists for TPP projects

Grid not showing

  • Verify Auto Create Grids is enabled
  • Ensure grid material is assigned (should auto-load from plugin)
  • Check that surfaces have the correct tags
  • Call RefreshGrids() if surfaces were added at runtime
  • Check that the placement type matches the surface tags

Audio not playing

  • Verify Sounds Enabled is true
  • Check Master Sound Volume is greater than 0
  • Ensure audio assets are properly loaded (should auto-load from plugin)
  • Check that your project's audio settings allow 2D/3D sounds

Performance issues

  • Disable Show Debug Info in shipping builds
  • Consider reducing grid density for large surfaces
  • Limit the number of concurrent preview actors
  • Use LODs for complex placeable objects