Skip to content

RevFramework – Pickups • Feedback

Folder: Runtime/Systems/Pickups/Feedback

The Feedback folder contains lightweight components that play visual or audio responses when pickups succeed or fail.
These components implement the IPickupFeedback or IPickupFailFeedback interfaces.

✔ Modular UX layer
✔ No gameplay code changes required
✔ Works with both interactable and trigger-based pickups


🎯 Purpose

Feedback components exist to:

  • Provide UX hooks for pickup success or failure
  • Keep core gameplay logic clean and isolated
  • Allow designers to add audio/visual responses without touching gameplay code

Feedback is purely optional. Removing this folder does not affect pickup logic.


🧩 Key Interfaces

IPickupFeedback

Invoked for successful pickups.

public interface IPickupFeedback
{
    void PlayFeedback(Transform at);
}

IPickupFailFeedback

Invoked for failed pickup attempts (e.g. inventory full, unmet conditions).

public interface IPickupFailFeedback
{
    void PlayFail(Transform at);
}

Both interfaces are invoked automatically by:

  • EffectPickupCore (trigger-based pickups)
  • PickupInteractableCoreBase (interactable pickups)

Attach feedback components directly to pickup prefabs, or assign them via the feedbacks / failFeedbacks arrays on interactable pickups.


📦 Built-in Feedback Components

✅ Success Feedback

Component Description
PickupSFX Plays a one-shot audio clip at the pickup location.
PickupVFX Spawns a VFX prefab with optional offset and lifetime.

❌ Failure Feedback

Component Description
PickupFailSFX Plays a failure or error sound at the pickup location.
PickupFailFlash Briefly flashes a SpriteRenderer or Renderer red.

🔁 Usage

  1. Add one or more IPickupFeedback components for success cases
  2. Add one or more IPickupFailFeedback components for failure cases
  3. Pickups invoke them automatically — no manual calls required

Example (success path from PickupInteractableCoreBase):

for (int i = 0; i < feedbacks.Length; i++)
    if (feedbacks[i] is IPickupFeedback fx && feedbacks[i].isActiveAndEnabled)
        fx.PlayFeedback(transform);

Failure feedback follows the same pattern using IPickupFailFeedback.


➕ Extending Feedback

To add custom feedback behaviour:

public class UIPopupFeedback : MonoBehaviour, IPickupFeedback
{
    public void PlayFeedback(Transform at)
    {
        MyUIPopupSystem.Show("Item collected!", at.position);
    }
}

Common Extensions

  • UI popups or toast notifications
  • Screen effects or camera shake
  • Haptics (mobile or controller rumble)
  • Analytics or telemetry hooks
  • Animation or Timeline triggers

🧱 Design Notes

  • Feedback components should never block or cancel gameplay logic
  • They should be fast, optional, and side-effect free
  • Failure feedback is advisory only — it does not affect pickup state

📘 See Also

  • Runtime — where feedback is triggered
  • InterfacesIPickupFeedback and IPickupFailFeedback