Skip to content

Reference

One possible placement. Blueprintable, group ItemSpawn. An editor-only actor (bIsEditorOnlyActor): it exists while you author and is stripped from cooked builds. Only its transform and tags ship, baked into the items that reference it.

Property Type Description
PointTags FGameplayTagContainer Designer tags describing this location (Spawn.Drawer, Spawn.Shelf). Baked into the item with the transform; query them on the item after assignment. See Point tags.
Transform channel Meaning
Location Where the item’s pivot will be.
Rotation How the item will be oriented. The point’s X axis (green arrow) becomes the item’s X axis.
Scale Multiplies the item’s own scale. Leave 1, 1, 1 for “item keeps its size”; scale the point to shrink or grow the item at this one location.

Editor visuals: a screen-size scaled billboard icon and a green arrow showing the facing. Neither renders in game.

Subclass the point in Blueprint (the demo does, with B_ItemSpawnPointBase) to give your team pre-tagged point types such as “Drawer Point” or “Shelf Point”.

The component you add to the item. Blueprint name Item Spawn Randomizer, component group ItemSpawn. Works on any actor. It doesn’t tick.

Property Type Default Description
bEnableRandomization bool true Per-item switch. Off = this item always starts at its authored location. Blueprint-readable.
bIncludeHomeLocation bool true On = the authored location competes as one more candidate, so the item can stay home. Off = the item always moves to one of the points whenever one is free.
SpawnPoints TArray<TSoftObjectPtr<AItemSpawnPoint>> empty Candidate points for this item. Points may be shared between items. Editor-only: their transforms and tags are baked into BakedPoints, and the references themselves never ship.
LocationOffset (advanced) FVector (cm) 0, 0, 0 Extra nudge in point-local space on top of the chosen point. For pivot fixes: “2 cm up from the shelf surface”. Shown in the ghosts.
RotationOffset (advanced) FRotator 0, 0, 0 Extra rotation in point-local space on top of the chosen point. Shown in the ghosts.
BakedPoints (advanced, read-only) TArray<FBakedItemSpawnPoint> — The baked candidates: the only spawn data that ships. Each entry holds the point’s id (object path), world transform and tags. Rebuilt on every save and cook.

Preview — Item Spawn | Preview (editor-only)

Section titled “Preview — Item Spawn | Preview (editor-only)”
Property Type Default Description
bShowSpawnPreviews bool true Draws ghost copies of this item on all referenced points. Turn off per item to quiet a busy level.
PreviewMaterialOverride UMaterialInterface* none One material for all ghost meshes, for example a translucent ghost material. None = the item’s real materials.
Button Description
Refresh Spawn Previews (RefreshSpawnPreviews) Re-bakes the candidate transforms and tags from the current points and rebuilds the ghosts. Use it after moving or re-tagging points. Also runs automatically on edits to the component, undo, save and after a Blueprint recompile.

All are BlueprintPure.

Function Returns
WasRelocated() true if the subsystem moved this item away from its authored location this session. false when it stayed home: by choice, because all points were taken, or because randomization is off.
GetHomeTransform() The authored world transform, captured before any relocation. Valid once the item has been assigned (from BeginPlay on).
GetAssignedPointTags() The tags of the point the item was moved to. Empty when it stayed home.
HasAssignedPointTag(Tag, bExactMatch = false) true if the assigned point carries a matching tag. Hierarchical by default: Spawn.Drawer matches a query for Spawn. bExactMatch requires equality.
Event Parameters Fires
OnRelocated UItemSpawnRandomizerComponent* Component, const FGameplayTagContainer& PointTags On the server or in standalone, right after the subsystem moves this item to a point.

SpawnPoints, the preview properties and RefreshSpawnPreviews are editor-only (WITH_EDITORONLY_DATA / WITH_EDITOR). Wrap any C++ that touches them accordingly.

A UWorldSubsystem, created in Game and PIE worlds only. In Blueprint, get it with Get ItemSpawnSubsystem; in C++ with GetWorld()->GetSubsystem<UItemSpawnSubsystem>().

Function Description
IsRandomizationEnabled() (static, pure) The effective master switch: the ItemSpawn.Enabled console override if set, otherwise the Project Settings value.
RerollAll() Re-randomizes every registered item with a fresh random seed. Each eligible item is first returned home, then assigned again from scratch; OnRelocated fires for items that move. Items that are hidden (picked up) or attached to another actor (held) are left alone and their points freed. Does nothing on clients.
GetRegisteredCount() (pure) Number of randomizer components registered in this world.
GetSessionSeed() (pure) The seed used for the current layout. Set it as Global Seed in Project Settings to reproduce the layout.

RegisterComponent and UnregisterComponent are C++ only and called by the component itself. You never need them.

Project Settings → Game → Item Spawn Randomizer (UItemSpawnSettings, saved to DefaultGame.ini).

Setting Property Default Effect
Enable Item Spawn Randomization bEnableItemSpawnRandomization true Master switch. Off = every item starts exactly where it is authored and the system does zero work. Read when items are assigned (world begin play), not mid-session. Per-item override: bEnableRandomization on the component.
Global Seed GlobalSeed 0 0 = a new random layout every session. Non-zero = deterministic: the same seed always produces the same layout.
Command Effect
ItemSpawn.Enabled -1 Use the Project Settings value (default).
ItemSpawn.Enabled 0 Force randomization off.
ItemSpawn.Enabled 1 Force randomization on.
ItemSpawn.Reroll Calls Reroll All on the current world: a new random layout immediately, skipping collected and held items.

ItemSpawn.Enabled is read at assignment time (world begin play). Set it, then reload the map.

Category What it logs
LogItemSpawn One summary line per world at begin play: on/off state, registered and relocated item counts, and the seed. At Verbose (Log LogItemSpawn Verbose) also each relocation (“‘Key_01’ relocated to spawn point ‘…’”) and items that stayed home because all their points were taken. Rerolls and point-list restores are logged here too.
LogItemSpawnPreview Editor only. Reports how many items had their point list restored after a Blueprint recompile.
Module Type Depend on it?
ItemSpawnRandomizer Runtime Yes, from any module that uses the plugin’s classes. Add GameplayTags too when you work with point tags.
ItemSpawnRandomizerEditor Editor Never from a runtime module.