Skip to content

00 — Pickups Quickstart (Minimal)


Goal

Show the smallest honest pickups flow and prove that pickups can execute behaviour without depending on Inventory or other systems.


What This Scene Demonstrates

This scene demonstrates two valid pickup execution paths:

  • Effect path Actor → PickupEffectRunner → effect executes behaviour

  • Custom pickup behaviour Interactable → custom logic → developer-defined result

The core mental model is:

Actor + Effect → Runner dispatch → Effect decides behaviour

The pickup system provides the flow and execution, but does not enforce where results are stored or how they are handled.


What To Look For

There are two observable flows in this scene:

1. Effect-based pickup (Teleport)

  • Trigger fires on overlap
  • PickupEffectRunner is called
  • Effect executes immediately
  • Result is visible in the world (player is moved)

2. Custom pickup behaviour (Sword)

  • Interactable handles input — this one is in PressToPickup mode, interact key F
  • Stand in its trigger and tap F; walking through it alone does nothing
  • Custom logic runs instead of Inventory integration
  • Item id is added to a simple runtime container
  • UI updates to reflect the change

3. Quickstart Panel

  • Actor and Effect are bound explicitly
  • Preflight shows:

  • IDamageable availability

  • Null-target support
  • Dispatch path (Reporting / Context / Standard)
  • Apply calls PickupEffectRunner.TryApply(...) and prints the bool it returned
  • Result message is the source of truth — including when it says the payload was refused

Sample Scope

This scene covers:

  • Effect execution through PickupEffectRunner
  • Trigger-based pickups
  • Interactable pickups with custom behaviour
  • Minimal runtime item storage (SimpleItemBag)

This scene does NOT cover:

  • Inventory system integration
  • Authority or multiplayer validation
  • Save/load or persistence
  • Production pickup spawning or pooling

Authority Note

This scene may include a permissive sample authority setup for demonstration purposes. 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. Test Trigger Pickup (Teleport)

  3. Walk into the cube

  4. Observe immediate effect execution (teleport)

  5. Test Interactable Pickup (Sword)

  6. Move into the sword's trigger

  7. Tap F (its interactKey; the mode is PressToPickup, so holding is not required)
  8. Observe item added to the runtime container
  9. UI updates immediately

  10. Test Quickstart Panel

  11. Assign:

  12. Actor → Player

  13. Effect → PickupEffect
  14. Review Preflight:

  15. IDamageable

  16. Allows Null
  17. Dispatch path
  18. Click Apply To Actor
  19. Observe result message

  20. Make the panel report a refusal

  21. TeleportEffect carries a 1 second cooldown

  22. Click Apply To Actor twice in quick succession
  23. The second result comes back as refused, not as a green "Applied…" — that is the cooldown gate reporting itself through TryApply
  24. The cooldown is keyed per (owner, effect), so walking into the teleport cube also starts it for the Player

Failure Behaviour

Failures come from the runner validation and effect execution path:

  • No Actor assigned Meaning: runner has no target Fix: assign a valid GameObject

  • No Effect assigned Meaning: no behaviour to execute Fix: assign a PickupEffect

  • Actor has no IDamageable and effect does not allow null Meaning: effect requires a valid damageable target Fix:

  • Add an IDamageable component

  • OR use an effect that allows null targets

  • Apply reports "refused" Meaning: TryApply returned false — the effect is still on cooldown for this owner, a decorator cancelled, or the effect declined. Nothing was applied. Fix: wait for the cooldown window (1s on TeleportEffect) and apply again

  • Context effect fails Meaning: the effect implements IPickupEffectWithContext and no reporting seam, so the runner calls it directly, skips the base gates, and assumes delivery — Apply reports success whatever the effect did Fix: inspect the effect implementation

  • Runtime exception Meaning: failure inside effect logic Fix: check effect expectations vs actor data


Behind The Scenes

This scene uses:

  • PickupEffectRunner.TryApply(...)
  • PickupEffect
  • IPickupEffectWithContext
  • TriggerPickup (the teleport cube, effect TeleportEffect, destroyOnUse, requiredTag "Player")
  • TriggerRelay3D (on both the cube and the sword)
  • InteractablePickupBase
  • SimpleItemPickupInteractable (the sword, PressToPickup, interact key F)
  • DebugKeysInputService (on the Player — this is what supplies the key state)
  • IDamageable

Key Takeaway

Pickups provide execution and flow, not storage or ownership.

  • Effects run through a consistent runner path
  • Custom behaviour can replace built-in integrations
  • The system does not enforce backend choices

You control where the result goes. The pickup system guarantees how it runs.