-
Notifications
You must be signed in to change notification settings - Fork 0
Blueprint Nodes
This page documents the new Blueprint-accessible nodes and events added for per-weapon targeting and production enemy logic.
Per-weapon targeting allows each weapon Data Asset to define its own targeting filters.
Common use cases:
- Boss-only weapons
- Door-only weapons
- Weapons that ignore normal enemies
- Weapons that only fire when a valid target exists
Important Data Asset settings:
-
Override Targeting Settings- Use this weapon's own targeting rules -
Targetable Classes- Only target specific actor classes -
Targetable Tags- Only target actors with specific tags -
Target Unspecified Actors- If false, unmatched actors are ignored -
Only Fire When Target Available- If true, the weapon does not fire without a valid target -
Targeting Range Override- Optional custom range for this weapon
Use these settings in the weapon Data Asset:
Override Targeting Settings -> true
Targetable Tags -> Boss
Target Unspecified Actors -> false
Only Fire When Target Available -> true
The weapon will only target actors with the Boss tag.
Use these settings in the weapon Data Asset:
Override Targeting Settings -> true
Targetable Tags -> Door
Target Unspecified Actors -> false
Only Fire When Target Available -> true
The weapon will only target actors with the Door tag.
Component: URFEnemyLogicComponent
URFEnemyLogicComponent is a reusable enemy behavior component for production ACharacter or APawn enemies.
Use this component when you do not want to inherit from AURFTestEnemy.
Recommended production enemy setup:
BP_ProductionEnemy
+-- CapsuleComponent
+-- SkeletalMesh
+-- URFHealthComponent
+-- URFEnemyLogicComponent
Sets which collision component applies contact damage.
SetContactDamageComponent(UPrimitiveComponent* NewComponent)
Use this if you want to explicitly choose a collision component instead of relying on Contact Damage Component Name.
Example:
BeginPlay
-> URFEnemyLogicComponent
-> SetContactDamageComponent(CapsuleComponent)
Manually sets the current target.
SetTarget(AActor* NewTarget)
Returns the current target.
GetTarget() -> AActor*
Returns the distance between the owner and the current target.
GetDistanceToTarget() -> float
Returns -1 if there is no valid target.
Processes XP and loot rewards without triggering death or destruction side effects.
HandleXPReward(AActor* Killer)
This function is safe to call manually if you only want to process rewards.
It does not:
- Mark the enemy as dying
- Unregister from Game Director
- Destroy the actor
Awards this enemy's XP reward directly to a player actor.
AwardXPToPlayer(AActor* Player)
The target actor must have URFExperienceComponent.
Spawns the configured guaranteed pickup.
SpawnGuaranteedPickup()
Spawns an XP pickup with a specific XP amount.
SpawnXPPickup(int32 InXPAmount)
Rolls and spawns random loot from the configured loot tables.
SpawnRandomLoot()
Registers the owner with URFGameDirector.
RegisterWithDirector()
Usually this is handled automatically when Auto Register With Director is enabled.
Unregisters the owner from URFGameDirector.
UnregisterFromDirector()
Usually this is handled automatically when the enemy dies or is removed.
Returns the cached URFHealthComponent.
GetHealthComponent() -> URFHealthComponent
Returns whether the enemy is alive.
IsAlive() -> bool
Called when a target is acquired.
OnTargetAcquired(AActor* Target)
Called when the current target is lost.
OnTargetLost(AActor* Target)
Called when the target changes.
OnTargetChanged(AActor* OldTarget, AActor* NewTarget)
Called when contact damage is dealt.
OnContactDamageDealt(AActor* Target, float DamageDealt)
Called when XP or loot rewards are processed.
OnRewardsProcessed(AActor* Killer, int32 XPAwarded, bool bPickupSpawned)
-
Auto Find Player- Automatically finds the player pawn as target -
Target Search Radius- Maximum search distance -
Target Update Interval- How often target search updates -
Continuous Player Search- Keeps searching after BeginPlay
-
Enable Contact Damage- Enables touch damage -
Contact Damage Component Name- Collision component name to bind, such asCapsuleComponent -
Contact Damage- Damage amount -
Damage Interval- Delay between repeated contact damage
Example for ACharacter enemies:
Enable Contact Damage -> true
Contact Damage Component Name -> CapsuleComponent
Contact Damage -> 10
Damage Interval -> 1.0
-
Enable Simple Follow Movement- Enables built-in simple follow movement -
Follow Movement Mode- Movement mode used by simple follow -
Follow Speed- Speed used byDirectActorMovement
Movement modes:
-
MovementInput- Uses UnrealAddMovementInput; speed is controlled by the owner's MovementComponent -
DirectActorMovement- Moves actor directly;FollowSpeedcontrols units per second
Prototype movement example:
Enable Simple Follow Movement -> true
Follow Movement Mode -> DirectActorMovement
Follow Speed -> 100
Production movement recommendation:
Enable Simple Follow Movement -> false
Use AIController, Behavior Tree, or your own movement logic
-
XP Reward- XP amount -
Reward Method- DirectOnKill, PickupOnly, or Hybrid -
Guaranteed Pickup Class- Pickup class for XP pickup reward -
Enable Random Loot- Enables loot table rolls -
Random Loot Tables- Loot data assets to roll from
Direct XP example:
XP Reward -> 10
Reward Method -> Direct On Kill
XP pickup example:
XP Reward -> 10
Reward Method -> Pickup Only
Guaranteed Pickup Class -> BP_XPPickup
-
Auto Register With Director- Automatically registers the enemy withURFGameDirector
-
Auto Add Enemy Tag- Automatically adds a tag on BeginPlay -
Auto Enemy Tag- Tag to add, usuallyEnemy
Default enemy setup:
Auto Add Enemy Tag -> true
Auto Enemy Tag -> Enemy
Boss setup example:
Auto Add Enemy Tag -> false
Actor Tags -> Boss
-
Handle Actor Destruction- If true,URFEnemyLogicComponentdestroys the actor after death -
Destruction Delay- Delay before destruction
Recommended production setup:
URFHealthComponent -> Destroy On Death -> true
URFEnemyLogicComponent -> Handle Actor Destruction -> false
This keeps destruction handled by URFHealthComponent, while URFEnemyLogicComponent handles rewards and Game Director unregistering.
AURFTestEnemy is still supported for quick prototyping and backward compatibility.
For production enemies, prefer creating your own ACharacter or APawn and adding:
URFHealthComponentURFEnemyLogicComponent
Updated total:
Total Blueprint Node Count: 265+
Additional distribution entry:
Enemy Logic Component: 13+ functions + 5 events