Interaction Effects
UEDInteractionEffectsComponent lets you attach reusable effects to any interactable without changing interaction logic.
It listens to UEDInteractableComponent events and plays one or more effects on a target mesh component (StaticMesh or SkeletalMesh).
Add to an interactable actor
- Add
UEDInteractableComponentto your actor. - Add
UEDInteractionEffectsComponentto the same actor. - In
UEDInteractionEffectsComponent:- Pick TargetMode:
FirstMeshComponent(recommended default)OwnerRootPrimitive(if the root is already the mesh)AllMeshComponents(apply to every mesh)TaggedPrimitiveComponents(use TargetComponentTag)SpecificComponent(use SpecificTargetComponent)
- Add effect classes to one or more event lists:
- Effects_OnInteractionSuccessful (non-destruction successful interactions)
- Effects_OnDamagedNotDestroyed (HitPoints damage ticks while HP > 0)
- Effects_OnInteractionDenied
- Pick TargetMode:
Effect selection is class-based (TSubclassOf<UEDInteractionEffect>): create a Blueprint class derived from an effect, tune its default properties, then select that class in the array.
Built-in effects
The plugin provides these effect classes:
UEDInteractionEffect_ShakeRotationUEDInteractionEffect_ShakeLocationUEDInteractionEffect_ScalePulseUEDInteractionEffect_MaterialScalarPulseUEDInteractionEffect_Sound
Context available to effects (Blueprint)
When an effect instance starts it receives a FEDInteractionEffectContext with:
- Interaction:
InteractionContext(tag, instigator, interactable actor, etc.) - Target:
TargetComponentplus booleans for StaticMesh/SkeletalMesh - View:
InstigatorViewLocation,InstigatorViewDirection - Location data:
InteractableLocationTargetComponentLocationResolvedHitLocation,ResolvedHitNormal,ResolvedHitBoneName- If a direct trace to the interactable was detected:
bHasDirectHit,DirectHitLocation,DirectHitNormal
Hit resolution behavior:
- If the target component is directly traceable along the view ray, the component hit is used.
- Otherwise, the closest point on collision is used as a fallback.
- If collision data is unavailable, the component bounds origin is used.
Creating a custom effect in Blueprint
- Create a Blueprint class derived from
UEDInteractionEffect. - Set up how the instance should be created:
- Use
InstanceClasswith a Blueprint class derived fromUEDInteractionEffectInstance, or - Override
CreateInstanceand return an object created withConstruct Object from Class.
- Use
- Create a Blueprint class derived from
UEDInteractionEffectInstance. - Override:
OnStartOnTick(optional)OnFinish(optional)
- In the instance, use
GetEffectContext()to access view/hit/target data.