02 — World Pickups + Interactables (Inventory Integration Context)¶
Goal¶
Show the real world-pickup flow and how pickup consumption routes into Inventory — and, in the process, the one authoring rule that decides whether a spawned pickup works at all.
What This Scene Demonstrates¶
This scene demonstrates the world-pickup runtime flow in an Inventory integration context:
runtime prefab catalog → spawned instance → relay resolves its receiver at Awake → the receiver's own rules (authority, actor test, interaction mode) → Inventory update
The pickup system owns the interaction and consume flow.
The catalog holds both kinds of receiver, which is the point of it having four entries rather than three.
Three of them are interactable pickups. Each carries an InventoryPickupInteractable and a TriggerRelay3D, and each grants a real ItemDefinition into the Player's Backpack through InventoryResolve — you press their interact key while standing in the trigger.
The fourth, TriggerPickup_Cube, is a TriggerPickup. It consumes on trigger entry with no key press, and its authored effect is deliberately left empty so Spawn assigns the one selected in the Effect list. Walk into it and it applies the effect and destroys itself.
Having one of each is what makes the panel's receiver reporting mean anything: the same Spawn button produces two different sets of rules, and the result line tells you which one you got.
The panel prepares and explains the setup. It does not directly apply effects and it does not fake successful consumption.
The Rule This Scene Teaches¶
TriggerRelay2D and TriggerRelay3D resolve a single IPickupTriggerReceiver, once, in Awake, and cache it. Awake has already run by the time Instantiate returns.
So the pickup component must be authored on the prefab. A TriggerPickup added after spawning is never wired to the relay: it sits on the object receiving nothing, silently. The Spawn tab therefore does not add one — it reads the instance the same way the relay does and tells you what it found:
- an authored
TriggerPickup→ Spawn configures it (effect, destroy-on-use, tag, layers) - some other receiver → Spawn names it and says the
TriggerPickupsettings do not apply - no receiver at all → Spawn says so, and says why it cannot be fixed from the panel
LootPickupSpawner carries the same rule in its own docs, for the same reason.
Interaction Modes, Keys and Prompts¶
All three catalog prefabs use F as their interact key. The key state comes from DebugKeysInputService on the Player.
| Prefab | Mode | What to do |
|---|---|---|
GoldHelmet | Auto | Walk into the trigger. It picks up on enter. |
GoldSword | PressToPickup | Stand in the trigger and tap F. |
ShortSword | HoldToPickup | Stand in the trigger and hold F for ~0.4s. |
No prompt is shown on screen. None of the three has promptUI assigned, so nothing tells the player a key is expected — walking into the Press or Hold prefab and away again simply does nothing. Assigning a prompt object to InteractablePickupBase.promptUI is the exercise; the base class enables it on enter and hides it again on exit, and only for non-Auto modes.
facingDotThreshold is -1 (off) and respawn is off on all three. Both are fields on InteractablePickupBase — set them on a prefab and spawn it again to see them work. No shipped scene enables either.
What To Look For¶
Read the panel through three tabs, then observe the Inventory result:
Runtime¶
- Choose a world pickup prefab from the runtime prefab catalog
- Use Search to filter larger catalogs
- Confirm the selected Prefab before spawning
- The Effect selector matters only for a prefab whose authored
TriggerPickuphas no effect of its own.TriggerPickup_Cubeis exactly that, so the selection is used when you spawn it and ignored when you spawn any of the three interactables — the result line says which happened
Spawn¶
- Set the Spawn Position
- Spawn the selected world pickup into the scene
- Read the result line: it names the receiver the relay resolved
- Destroy On Use, Required Tag and the layer mask are
TriggerPickupsettings. Spawn applies them toTriggerPickup_Cubeand they have no effect on the three interactable prefabs — the result line says so when that is the case. Setting Required Tag to something the Player does not carry is the cheapest way to watch a pickup refuse an actor that walked right through it
Runtime Consumption (Scene)¶
- Move the Player (WASD) into the spawned trigger
- For
GoldSword/ShortSword, press or hold F InventoryPickupInteractablechecksPickupAuthority, then grants the item- The container updates
Inventory Observation (Support Panel)¶
- Use the Inventory Quickstart panel to observe container state
- Confirm item grants after successful pickup consumption
Sample Scope¶
This scene covers:
- Runtime catalog selection for world pickup prefabs
- Spawning a world pickup prefab during Play Mode
- Reporting which
IPickupTriggerReceivera spawned prefab actually carries - Configuring an authored
TriggerPickup's destroy, layer and tag settings - The three
InteractablePickupBaseinteraction modes on real prefabs - Testing the real scene-trigger consume path
- Routing pickup results into Inventory
This scene does NOT cover:
- Adding a pickup component to a spawned prefab — see the rule above, it cannot work
- A
TriggerPickupworld pickup (scene00has one: the teleport cube) - Prompt UI, facing checks or respawn wired up — the fields exist on the prefabs, unset
- Direct effect application from the panel
- Decorator-chain inspection
- Inventory system internals or data modelling
- Crafting or other system integrations
- Save/load or persistence
- Production spawning or pooling rules
Authority Note¶
This scene includes a PickupAuthorityBinder with alwaysTrue enabled — a permissive sample setup. Since 1.3.0 InteractablePickupBase resolves and honours it in TryPickup, so every interactable in the scene is gated by it — including SimpleItemPickupInteractable, which makes no check of its own. Because this binder answers true, nothing is refused here; swap in an implementation that denies to see the gate bite. Production projects should enforce their own authority rules.
Networking Reminder¶
No networking is included in this sample. Multiplayer integration (Mirror, NGO, Photon, etc.) is the developer’s responsibility.
How To Use¶
-
Enter Play Mode
-
Review the Authority message
-
PickupAuthorityBinderis present withalwaysTrueon, so consumes are allowed -
Turn
alwaysTrueoff to watch the interactable refuse instead -
Open the Runtime tab
-
Select a World Prefab from the runtime prefab catalog
-
Confirm Current Prefab
-
Open the Spawn tab
-
Set Spawn Position
- Click Spawn World Pickup
-
Read which receiver the result line names
-
Test the pickup in the scene
-
Move the Player into the spawned trigger
- Press or hold F if the prefab is in
PressToPickuporHoldToPickupmode - Observe pickup consumption
- Observe Inventory updating through the Inventory Quickstart panel
Failure Behaviour¶
Failures come from setup requirements or the real runtime consume path:
-
No runtime world prefabs configured Meaning: runtimeWorldPrefabs is empty Fix: populate runtimeWorldPrefabs in the Inspector
-
No world prefab selected Meaning: Spawn has no prefab to instantiate Fix: go to Runtime and choose a World Prefab
-
Spawn reports "no IPickupTriggerReceiver" Meaning: the prefab authored neither a
TriggerPickupnor anInteractablePickupBasesubclass, so nothing will consume it Fix: author one on the prefab. It cannot be added after Instantiate — the relay has already resolved -
Spawn reports a receiver that is not a TriggerPickup Meaning: the prefab drives its own consume logic, so the Effect, Destroy On Use, Required Tag and layer settings on the Spawn tab do not apply Fix: nothing — this is the normal case for the three prefabs in this scene
-
Nothing happens when standing in the trigger Meaning: the prefab is in
PressToPickuporHoldToPickupmode and is waiting for its interact key Fix: press or hold F. There is no on-screen prompt becausepromptUIis unassigned -
PickupAuthorityBinder blocks consumes Meaning: authority denied pickup consumption Fix: enable
alwaysTruefor this demo, replace the binder, or use an actor that has authority -
The actor is not recognised Meaning:
InventoryPickupInteractableaccepts an actor taggedPlayeror carrying aCharacterInventoryFix: tag the actorPlayer, or give it aCharacterInventory -
Grant is refused Meaning: the inventory service declined — usually no room in the target container Fix: make room in the Backpack, or check the size policy on
SceneInventoryService -
Trigger does not fire Meaning: trigger/collider/relay setup is missing or incorrect Fix: fix the prefab trigger setup instead of relying on the panel fallback
Behind The Scenes¶
This scene uses:
- TriggerRelay3D
- IPickupTriggerReceiver
- InteractablePickupBase (Auto / PressToPickup / HoldToPickup)
- InventoryPickupInteractable
- PickupAuthority.Resolve(...)
- IPickupAuthority
- PickupAuthorityBinder
- InventoryResolve / SceneInventoryService
- CharacterInventory
- DebugKeysInputService (on the Player — supplies the interact key state)
TriggerPickup and PickupEffect are supported by the panel but are not present in this scene. Scene 00 is where a TriggerPickup is wired up.
Key Takeaway¶
Pickups own the world interaction and consume flow.
A relay resolves one receiver at Awake, so the receiver has to be on the prefab. That is not a limitation of the panel — it is the shape of the system, and the panel's job is to report it rather than paper over it.
When Inventory is present, pickup behaviour can route results into Inventory without changing the pickup system itself.