Skip to content

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 TriggerPickup settings 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 TriggerPickup has no effect of its own. TriggerPickup_Cube is 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 TriggerPickup settings. Spawn applies them to TriggerPickup_Cube and 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
  • InventoryPickupInteractable checks PickupAuthority, 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 IPickupTriggerReceiver a spawned prefab actually carries
  • Configuring an authored TriggerPickup's destroy, layer and tag settings
  • The three InteractablePickupBase interaction 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 TriggerPickup world pickup (scene 00 has 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

  1. Enter Play Mode

  2. Review the Authority message

  3. PickupAuthorityBinder is present with alwaysTrue on, so consumes are allowed

  4. Turn alwaysTrue off to watch the interactable refuse instead

  5. Open the Runtime tab

  6. Select a World Prefab from the runtime prefab catalog

  7. Confirm Current Prefab

  8. Open the Spawn tab

  9. Set Spawn Position

  10. Click Spawn World Pickup
  11. Read which receiver the result line names

  12. Test the pickup in the scene

  13. Move the Player into the spawned trigger

  14. Press or hold F if the prefab is in PressToPickup or HoldToPickup mode
  15. Observe pickup consumption
  16. 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 TriggerPickup nor an InteractablePickupBase subclass, 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 PressToPickup or HoldToPickup mode and is waiting for its interact key Fix: press or hold F. There is no on-screen prompt because promptUI is unassigned

  • PickupAuthorityBinder blocks consumes Meaning: authority denied pickup consumption Fix: enable alwaysTrue for this demo, replace the binder, or use an actor that has authority

  • The actor is not recognised Meaning: InventoryPickupInteractable accepts an actor tagged Player or carrying a CharacterInventory Fix: tag the actor Player, or give it a CharacterInventory

  • 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.