Zum Hauptinhalt springen

Example Pickup Actor

The setup PDF's simple pickup actor is a project example, not a native class shipped by this plugin. Create an Actor
with a Static Mesh and a Sphere Collision component, and add instance-editable, exposed-on-spawn ItemID (Name) and
Amount (Integer) variables.

Enable overlap events and configure collision to detect the intended player Pawn. In multiplayer, replicate the
pickup actor and its remaining amount if clients display it. Process collection on authority and verify that the
Pawn is allowed to collect this object.


Preserve Partial Adds​

Authority overlap → validate Pawn and pickup amount
→ Get InventorySubSystem
→ AddAmount(Pawn, ItemID, Amount)
→ if bSuccess: Amount -= OutAddedAmount
→ destroy/deactivate only when Amount == 0

AddAmount can succeed with fewer items than requested. Destroying the pickup whenever bSuccess is true loses the
remainder. A failed operation keeps the pickup available. Guard against repeated overlap collection and only subtract
the confirmed OutAddedAmount once per accepted request.

For a singleplayer test, use the same authoritative call and inspect the returned count. For client interaction,
route intent through the project RPC described in Multiplayer, then validate again on the server.
A BlueprintCallable subsystem function does not automatically execute on the server.