Object Pickup provides the trigger, feedback and lifetime shared by Health Pickup and Item Pickup. Choose the concrete result, then configure one owner for collection, removal and reuse.

Create a world pickup

  1. Open Tools > Opsive > Ultimate Character Controller > Object Manager. In Object Builder, enter a Name, choose Object Type, and assign the visible model to GameObject. Use a world model for an item.
  2. Select Build Object, save under the project’s Assets folder, and open the prefab.
  3. Enable Is Trigger on a Collider on the same GameObject as the pickup component. Size it around the collection area and configure Unity’s collision matrix for the collecting character.
  4. Configure the result, feedback and lifetime before placing the object.
Object type Result and components to finish
Health Pickup Sphere Collider, Health Pickup and Respawner. Explicitly enable Is Trigger. The receiving hierarchy needs a living IDamageTarget, such as Health or Character Health.
Item Pickup Solid Box Collider, trigger Sphere Collider, Item Pickup and Respawner on the Visual Effect layer. The character needs an enabled Inventory and Character Layer Manager.
Dropped Item Item Pickup and both colliders with Trajectory Object. Assign this prefab to a Character Item’s Drop Prefab and configure the Drop ability.

For Item Pickup, the entering collider must be on the character’s main collision layer. Equippable loot also needs a Character Item, compatible slots, Item Set rules, Item Set Manager and Equip Unequip abilities.

Shared settings

Field Default Purpose
Trigger Enable Delay 4 seconds Reuse delay. Without a Rigidbody it starts at initialization; with one it starts after the body settles. First ordinary scene activation is immediate.
Pickup On Trigger Enter Enabled Select contact collection for Item Pickup. Use the contact Health Pickup or a custom controlled healing interaction as separate workflows.
Rotation Speed (0, 0, 0) Euler display rotation applied each physics update.
Destroy Delay 0 seconds Remove immediately; a positive delay keeps the depleted model temporarily; -1 keeps it visible and depleted.
Pickup Audio Clip Set Empty Collection audio when UCC finds a camera associated with the collector.
Pickup Message Text, Pickup Message Icon Empty, None Post-collection Message Monitor feedback.
On Select, On Deselect No listeners Feedback for Detect Object selection changes.

Enabled Health Pickup Inspector with Trigger Enable Delay 4, Health Amount 40, Always Pickup disabled, and complete selection, audio and UI fields.

The contact Health Pickup illustrates shared trigger-delay, lifetime, selection and feedback fields alongside its healing settings.

Use a separate startup gate when a scene pickup must initially wait. For a dropped object driven by Trajectory Object, choose a delay covering its flight or use a project-owned landing gate. Deliberately reinitialize retained depleted objects before collecting them again.

Choose the collection route

For health, use a positive Health Amount and a living target with valid Health and optional Shield attributes. Built-in Health restores Health first, then applies the remainder to Shield. Leave Always Pickup disabled to require a changed value; enable it for consumption by a full living target. For input- or animation-gated healing, implement an externally controlled IObjectPickup and call DoPickup at the intended interaction point.

For items, populate Item Definition Amounts with valid definitions and positive quantities. Precheck capacity in a project-owned collection gate when full inventories must leave the object available or a bundle must transfer atomically. Validate accepted amounts separately from world-object depletion.

Keep Pickup On Trigger Enter enabled for contact collection. For an animated item pickup, disable it and configure an enabled, input-driven Pickup ability, detection layers and pickup/completion animation events or durations. Use an empty definition filter or one matching definition per ability. Reservation can deplete the object before transfer; use a positive Destroy Delay to retain its model through the reach.

Feedback and lifetime ownership

On depletion, OnObjectPickedUp(ObjectPickup pickup) runs on the collector. Connect Message Monitor, camera/audio and selection listeners to their respective workflows. Contact collection and Detect Object selection are separate event paths.

Pooled pickups return through the Opsive pool. Ordinary pickups deactivate; a configured Respawner can return them with Schedule Respawn On Disable. Keep one deliberate reuse path and consume the object once per initialization. ObjectPickup and ItemPickupBase are abstract extension bases; a custom result implements IObjectPickup.DoPickup(GameObject target) and owns its acceptance policy.

Persist authoritative Inventory/Health values together with any world depletion and timing state needed after loading. For supported multiplayer, let the authoritative peer accept one collection and replicate both the result and world-object removal through the installed bridges.

Verify collection and reuse

  1. Collect with the real character. Confirm the result changes once, feedback occurs and the world object depletes once.
  2. Test Health and Shield deficits, full values with each Always Pickup setting, and a dead target.
  3. For items, compare requested and accepted amounts with free, partial and full capacity. Confirm equipment policy for the actual contact or animation route.
  4. For animation, confirm reservation, transfer and completion occur at their configured points. Check both selection events and collection feedback.
  5. Respawn or pool-reuse the pickup. Confirm its position, delay and one further collection. Recheck world ownership after save/load and multiplayer replication.

The complete Item Pickup workflow covers inventory creation, equipment and drops; the concrete pages provide result-specific settings.