$npx -y skills add teixasalone/UnrealEngine5-Skills --skill ue5-world-interactionUE5.6/UE5.7 world interaction systems for pickups, spawners, overlap/trace checks, and visual feedback. Use when requests involve interactive world actors, spawn logic, pickup behavior, interaction radius checks, success/failure feedback, and actor lifecycle control.
| 1 | # Quick Start |
| 2 | - Define interaction model: overlap-driven, trace-driven, or explicit use key. |
| 3 | - Define actor set: pickup actor, optional spawner, optional visual mapping data asset. |
| 4 | - Output runtime state transitions from spawn to interaction resolution. |
| 5 | |
| 6 | # UE5.7 API Anchors |
| 7 | - Detection anchors: |
| 8 | - `USphereComponent`, `UBoxComponent` |
| 9 | - `UPrimitiveComponent::OnComponentBeginOverlap` |
| 10 | - `UPrimitiveComponent::OnComponentEndOverlap` |
| 11 | - `FHitResult` |
| 12 | - Trace anchors: |
| 13 | - `UWorld::LineTraceSingleByChannel(...)` |
| 14 | - `UWorld::SweepSingleByChannel(...)` |
| 15 | - `UKismetSystemLibrary::SphereTraceSingle(...)` |
| 16 | - Lifecycle anchors: |
| 17 | - `AActor::SetActorHiddenInGame(...)` |
| 18 | - `AActor::SetActorEnableCollision(...)` |
| 19 | - `AActor::Destroy(...)` |
| 20 | - `AActor::SetActorTickEnabled(...)` |
| 21 | - Networking anchors: |
| 22 | - server authority validation for interaction success |
| 23 | - replicated result state for client feedback |
| 24 | |
| 25 | # Interaction Stage Contract |
| 26 | - Every interaction feature must define: |
| 27 | - Detection source (overlap/trace/use-key) |
| 28 | - Eligibility checks (distance, tags, inventory/capacity, authority) |
| 29 | - Success and failure result payloads |
| 30 | - Feedback path (VFX/SFX/UI) |
| 31 | - Post-interaction lifecycle policy (destroy/disable/cooldown/respawn) |
| 32 | - If any item is missing, interaction behavior is underspecified. |
| 33 | |
| 34 | # Workflow |
| 35 | ## 1) Actor and Component Setup |
| 36 | - Build root + collision + visual components with explicit collision channels. |
| 37 | - Define default states (`active`, `cooldown`, `consumed`) and replication needs. |
| 38 | - Keep collision shape and bounds aligned with intended interaction distance. |
| 39 | |
| 40 | ## 2) Detection Path |
| 41 | - Overlap model: bind begin/end overlap delegates on collision component. |
| 42 | - Trace model: run line/sphere traces on input request and validate hit actor/component. |
| 43 | - Keep detection deterministic by explicit channels/profiles. |
| 44 | |
| 45 | ## 3) Eligibility and Authority |
| 46 | - Validate target state, range, actor validity, and gameplay conditions. |
| 47 | - In multiplayer, validate success on server before mutating shared state. |
| 48 | - Return structured failure reason on rejection. |
| 49 | |
| 50 | ## 4) Resolve Interaction |
| 51 | - On success: apply effect (grant item, trigger state change, start cooldown). |
| 52 | - On failure: keep state stable and emit reason-specific feedback. |
| 53 | - Prevent re-entrant execution during in-progress resolution. |
| 54 | |
| 55 | ## 5) Feedback Path |
| 56 | - Emit VFX/SFX/UI feedback for both success and failure paths. |
| 57 | - Separate cosmetic-only effects from authoritative gameplay mutations. |
| 58 | - Keep feedback idempotent for repeated client updates. |
| 59 | |
| 60 | ## 6) Lifecycle and Cleanup |
| 61 | - Choose lifecycle explicitly: destroy, hide+disable collision, or reuse via respawn timer. |
| 62 | - If spawner exists, track spawned instances and cleanup on reset/despawn. |
| 63 | - Disable tick for dormant interaction actors when not needed. |
| 64 | |
| 65 | # Constraints |
| 66 | - Keep interaction validation server-authoritative in multiplayer. |
| 67 | - Ensure collision channels and trace responses are explicit. |
| 68 | - Keep spawner randomization deterministic when reproducibility is needed. |
| 69 | - Avoid hidden side effects in `Tick` without clear need. |
| 70 | - Do not destroy actors before broadcasting required success/failure feedback. |
| 71 | - Keep overlap and trace paths functionally equivalent when both are enabled. |
| 72 | |
| 73 | # Failure Handling |
| 74 | - Symptom: overlap never triggers. |
| 75 | - Locate: collision enabled state, overlap flags, collision channel responses. |
| 76 | - Fix: enable overlap generation, set proper channel responses, verify component bounds. |
| 77 | - Symptom: trace path misses obvious targets. |
| 78 | - Locate: trace channel/profile and ignore actor list. |
| 79 | - Fix: align trace channel/profile and reduce self/owner ignore misuse. |
| 80 | - Symptom: interaction triggers multiple times. |
| 81 | - Locate: missing in-progress guard and duplicated delegate bindings. |
| 82 | - Fix: add state guard and ensure single bind per component. |
| 83 | - Symptom: client sees success but server rejects. |
| 84 | - Locate: authority checks and RPC validation path. |
| 85 | - Fix: move final validation to server and replicate authoritative result. |
| 86 | - Symptom: consumed pickup remains interactable. |
| 87 | - Locate: lifecycle state and collision disable logic. |
| 88 | - Fix: disable collision/interaction immediately after confirmed success. |
| 89 | - Symptom: spawned interactables leak over time. |
| 90 | - Locate: spawner bookkeeping and reset cleanup path. |
| 91 | - Fix: track spawned instances and destroy/disable stale instances on respawn cycle. |
| 92 | - Symptom: frame spikes near dense interaction areas. |
| 93 | - Locate: per-frame trace/overlap workload and unnecessary ticking. |
| 94 | - Fix: reduce polling frequency, gate traces by input/distance, disable idle tick. |
| 95 | |
| 96 | # Interaction Authority Ops |
| 97 | - Use server-validated interaction resolution for shared gameplay effects. |
| 98 | - Use client-side prediction |