-
Notifications
You must be signed in to change notification settings - Fork 0
Step 9: Weapon System Guide
URF provides a Vampire Survivors-style multi-weapon system with weapon slots, auto-fire, cooldowns, targeting, weapon leveling, and support for multiple weapon behavior types.
The weapon system is component-based. For production projects, you do not need to inherit from AURFTestPlayer. You can use your own ACharacter or APawn and add URFWeaponComponent.
- 6-slot weapon inventory
- Auto-fire support
- Weapon cooldowns
- Weapon leveling
- Weapon evolution support
- Multiple weapon behavior types
- Class/tag-based targeting
- Per-weapon targeting overrides
- Boss-only, door-only, or custom target weapons
- Blueprint-friendly setup through Data Assets
Create your own player Blueprint from ACharacter or APawn, then add:
URFWeaponComponent
Recommended full player setup:
BP_PlayerCharacter
+-- CapsuleComponent or custom collision
+-- SkeletalMesh or StaticMesh
+-- SpringArmComponent
+-- CameraComponent
+-- URFHealthComponent
+-- URFExperienceComponent
+-- URFWeaponComponent
+-- URFPlayerStatsComponent
+-- URFLevelUpSystem
+-- URFVacuumComponent
AURFTestPlayer still exists and works for quick prototyping, but production projects should use their own player class with URF components.
- Right-click in Content Browser
- Select Data Asset
- Choose a weapon data asset class, such as:
URFWeaponDataAssetURFExampleProjectileDataAssetURFExampleMeleeDataAssetURFExampleAreaDataAssetURFExampleOrbitDataAssetURFExampleBeamDataAssetURFExampleSummonDataAssetURFExamplePassiveDataAsset
- Name it, for example
DA_MagicWand
Example basic values:
Weapon Name -> Magic Wand
Weapon Type -> Projectile
Targeting Type -> Nearest Enemy
Damage -> 15
Cooldown -> 1.5
Speed -> 800
ActorClass -> BP_MagicWandProjectile
Open your player Blueprint.
In URFWeaponComponent:
Starting Weapons
+-- DA_MagicWand
Make sure auto-fire is enabled if you want weapons to fire automatically.
Auto Fire Enabled -> true
Open your player Blueprint.
In URFLevelUpSystem:
Available Weapons Pool
+-- DA_MagicWand
+-- DA_Knife
+-- DA_Garlic
+-- DA_SantaWater
When the player levels up, these weapons can appear as card options.
Weapon Type controls what kind of weapon behavior is created.
Fires projectile actors.
Common examples:
Magic Wand
Knife
Axe
Typical behavior:
Projectile actor is spawned
Projectile moves toward target or direction
Projectile applies damage on hit
Creates a melee or aura-style damage actor.
Common examples:
Garlic
Whip
Typical behavior:
Damage area stays near player
Applies damage repeatedly
Often uses area/radius logic
Creates temporary damage zones.
Common examples:
Santa Water
Lightning Ring
Typical behavior:
Area actor spawns at or near a target location
Area remains active for a duration
Enemies inside the area take damage
Creates orbiting damage objects around the player.
Common examples:
King Bible
Song of Mana style orbiters
Typical behavior:
Orbit actors rotate around player
Enemies hit by orbit objects take damage
Often spawned once and kept active
Creates a beam-style damage actor.
Common examples:
Death Spiral
Hellfire-style beam
Typical behavior:
Beam rotates or points in a direction
Enemies intersecting the beam take damage
Creates independent actors or helper objects.
Common examples:
Bone
AI helpers
Typical behavior:
Summoned actor exists for a duration
May move independently
May damage enemies on collision or behavior logic
Applies passive effects or stat-style behavior.
Common examples:
Laurel
Regen Ring
Passive stat items
Typical behavior:
No normal firing required
Applies passive effect, protection, or stat bonus
Targeting Type controls how a weapon chooses or uses a target.
Common values include:
None
Nearest Enemy
Area
Examples:
Projectile + Nearest Enemy
Projectile weapon fires toward the nearest valid target.
Melee + Area
Melee/aura weapon affects actors inside an area.
Orbit + None
Orbit weapon does not need a target; it rotates around the player.
Beam + None
Beam weapon can rotate or use its own direction logic without selecting a target.
Important: Weapon Type defines the weapon behavior. Targeting Type defines how the weapon chooses or uses targets. Some weapon types do not need an aimed target.
Weapons can now override targeting settings individually.
This allows different weapons to target different actor types.
Examples:
- Normal weapons target enemies
- BossKiller weapon targets only bosses
- DoorBreaker weapon targets only doors
- A weapon fires only when its valid target exists
Open a weapon Data Asset and find the Targeting section.
Override Targeting Settings -> true
When enabled, this weapon uses its own targeting rules.
When disabled, the weapon uses the global targeting settings from the weapon component.
Use this when the weapon should only target specific classes.
Example:
Targetable Classes
+-- BP_BossEnemy
Use this when the weapon should only target actors with specific tags.
Example:
Targetable Tags
+-- Boss
Tags are useful when different actor classes should share the same targeting category.
Target Unspecified Actors -> false
When false, actors that do not match the configured class/tag filters are ignored.
For strict filters like boss-only, door-only, or crystal-only weapons, keep this false.
Only Fire When Target Available -> true
When true, the weapon does not fire unless it can find a valid target.
This is important for special weapons like boss-only weapons. If no boss exists, the weapon stays idle instead of wasting cooldown.
Targeting Range Override -> 0
When set to 0, the weapon uses the global targeting range.
Set a positive value if this weapon should have its own targeting range.
Example:
Targeting Range Override -> 3000
Goal:
Attack regular enemies only.
Ignore bosses or special actors unless they also use the Enemy tag.
Weapon Data Asset:
Override Targeting Settings -> true
Targetable Tags
+-- Enemy
Target Unspecified Actors -> false
Only Fire When Target Available -> true
Enemy actor:
Actor Tags
+-- Enemy
For production enemies using URFEnemyLogicComponent, this is the default setup:
Auto Add Enemy Tag -> true
Auto Enemy Tag -> Enemy
Goal:
Only fire at bosses.
Only damage bosses.
Do nothing when no boss exists.
Ignore regular enemies.
Weapon Data Asset:
Override Targeting Settings -> true
Targetable Tags
+-- Boss
Target Unspecified Actors -> false
Only Fire When Target Available -> true
Boss actor:
Actor Tags
+-- Boss
If the boss uses URFEnemyLogicComponent, you can configure it like this:
Auto Add Enemy Tag -> false
Then add the Boss tag manually.
Or:
Auto Add Enemy Tag -> true
Auto Enemy Tag -> Boss
Use the second option only if you want this actor to be considered a boss target instead of a normal enemy target.
Goal:
Only attack doors.
Ignore enemies.
Do not fire unless a door exists.
Weapon Data Asset:
Override Targeting Settings -> true
Targetable Tags
+-- Door
Target Unspecified Actors -> false
Only Fire When Target Available -> true
Door actor:
Actor Tags
+-- Door
Scenario:
Boss and minions are near the player.
Normal weapons should attack minions.
BossKiller should attack only the boss.
BossKiller should stay idle when no boss exists.
Minion setup:
Auto Add Enemy Tag -> true
Auto Enemy Tag -> Enemy
Boss setup:
Auto Add Enemy Tag -> false
Actor Tags
+-- Boss
Normal weapon:
Override Targeting Settings -> true
Targetable Tags
+-- Enemy
Target Unspecified Actors -> false
Only Fire When Target Available -> true
BossKiller weapon:
Override Targeting Settings -> true
Targetable Tags
+-- Boss
Target Unspecified Actors -> false
Only Fire When Target Available -> true
Result:
Normal weapons attack minions.
BossKiller attacks the boss.
BossKiller does not fire when there is no boss.
Per-weapon targeting affects both target selection and damage filtering.
This means a boss-only weapon should not damage normal enemies even if its projectile or area overlaps them.
For strict behavior:
Override Targeting Settings -> true
Targetable Tags -> Boss
Target Unspecified Actors -> false
This keeps both targeting and damage filtering aligned.
- Create
URFExampleProjectileDataAsset - Name it
DA_WandTest - Set:
Weapon Type -> Projectile
Targeting Type -> Nearest Enemy
ActorClass -> BP_MyProjectileActor
- Add it to:
URFWeaponComponent -> Starting Weapons
- Press Play.
Expected result:
Weapon fires projectiles at nearest valid enemy.
- Create
URFExampleMeleeDataAsset - Name it
DA_GarlicTest - Set:
Weapon Type -> Melee
Targeting Type -> Area
ActorClass -> BP_MyMeleeActor
- Add it to starting weapons.
- Press Play.
Expected result:
Aura-style damage actor spawns and damages nearby valid enemies.
- Create or duplicate a projectile weapon Data Asset
- Set:
Override Targeting Settings -> true
Targetable Tags -> Boss
Target Unspecified Actors -> false
Only Fire When Target Available -> true
- Create an enemy actor with:
Actor Tags
+-- Boss
- Place normal enemies with:
Actor Tags
+-- Enemy
- Press Play.
Expected result:
BossKiller targets the boss.
BossKiller ignores normal enemies.
BossKiller stays idle if no boss exists.
Check:
-
URFWeaponComponent -> Auto Fire Enabledis true - Weapon Data Asset is added to
Starting Weaponsor acquired through level-up - Weapon cooldown is not too high
- Weapon has a valid
ActorClassif required - There is a valid target in range
- If
Only Fire When Target Availableis true, the weapon waits until a valid target exists - If per-weapon targeting is enabled, the target must match the weapon's class/tag filters
Check:
-
Override Targeting Settingsis enabled -
Targetable TagsorTargetable Classesare configured correctly -
Target Unspecified Actorsis false for strict filtering - The actor does not accidentally have an unwanted tag
- The weapon actor is receiving the correct damage filter
Check:
- Boss actor has the
Bosstag - Weapon has
Override Targeting Settings -> true - Weapon has
Targetable Tags -> Boss Target Unspecified Actors -> false- Boss is inside targeting range
- Weapon cooldown is ready
Check:
- Normal enemies do not have the
Bosstag - Boss-only weapon has
Target Unspecified Actors -> false - Weapon actor supports damage filtering
- The weapon was spawned with the correct per-weapon targeting settings
Check:
- Enemy actors have the expected tag, usually
Enemy - Production enemies using
URFEnemyLogicComponenthave:Auto Add Enemy Tag -> true Auto Enemy Tag -> Enemy - Targeting range is large enough
- Enemy has
URFHealthComponent - Enemy collision is valid for the weapon type
- 6-slot weapon inventory
- Auto-fire system
- Multiple weapon behavior types
- Weapon Data Asset workflow
- Weapon leveling
- Weapon evolution support
- Global targeting
- Per-weapon targeting overrides
- Class/tag-based filtering
- Damage filtering aligned with targeting filters
- Blueprint-friendly setup
- Production player support through
URFWeaponComponent
- Use
AURFTestPlayerfor quick prototypes only. - For production, add
URFWeaponComponentto your ownACharacterorAPawn. - Use tags such as
Enemy,Boss,Door, orBreakablefor clear targeting rules. - Use
Only Fire When Target Availablefor special-purpose weapons. - Keep
Target Unspecified Actorsfalse when you need strict filtering.