Skip to content

Step 9: Weapon System Guide

Can TATAR edited this page Jun 9, 2026 · 2 revisions

Weapon System - Quickstart Guide

Overview

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.


Key Features

  • 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

Production Setup

Step 1: Add Weapon Component to Player

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.


Step 2: Create Weapon Data Asset

  1. Right-click in Content Browser
  2. Select Data Asset
  3. Choose a weapon data asset class, such as:
    • URFWeaponDataAsset
    • URFExampleProjectileDataAsset
    • URFExampleMeleeDataAsset
    • URFExampleAreaDataAsset
    • URFExampleOrbitDataAsset
    • URFExampleBeamDataAsset
    • URFExampleSummonDataAsset
    • URFExamplePassiveDataAsset
  4. 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

Step 3: Add Starting Weapons

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

Step 4: Add Weapons to Level-Up Pool

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 Types

Weapon Type controls what kind of weapon behavior is created.

Projectile

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

Melee

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

Area

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

Orbit

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

Beam

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

Summon

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

Passive

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

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.


Per-Weapon Targeting

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

Per-Weapon Targeting Settings

Open a weapon Data Asset and find the Targeting section.

Override Targeting Settings

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.


Targetable Classes

Use this when the weapon should only target specific classes.

Example:

Targetable Classes
+-- BP_BossEnemy

Targetable Tags

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

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

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

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

Example: Normal Enemy Weapon

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

Example: BossKiller Weapon

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.


Example: DoorBreaker Weapon

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

Example: Boss and Minions

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.

Actor Damage Filtering

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.


Quick Test: Magic Wand

  1. Create URFExampleProjectileDataAsset
  2. Name it DA_WandTest
  3. Set:
Weapon Type -> Projectile
Targeting Type -> Nearest Enemy
ActorClass -> BP_MyProjectileActor
  1. Add it to:
URFWeaponComponent -> Starting Weapons
  1. Press Play.

Expected result:

Weapon fires projectiles at nearest valid enemy.

Quick Test: Garlic

  1. Create URFExampleMeleeDataAsset
  2. Name it DA_GarlicTest
  3. Set:
Weapon Type -> Melee
Targeting Type -> Area
ActorClass -> BP_MyMeleeActor
  1. Add it to starting weapons.
  2. Press Play.

Expected result:

Aura-style damage actor spawns and damages nearby valid enemies.

Quick Test: BossKiller

  1. Create or duplicate a projectile weapon Data Asset
  2. Set:
Override Targeting Settings -> true
Targetable Tags -> Boss
Target Unspecified Actors -> false
Only Fire When Target Available -> true
  1. Create an enemy actor with:
Actor Tags
+-- Boss
  1. Place normal enemies with:
Actor Tags
+-- Enemy
  1. Press Play.

Expected result:

BossKiller targets the boss.
BossKiller ignores normal enemies.
BossKiller stays idle if no boss exists.

Troubleshooting

Weapon Not Firing

Check:

  1. URFWeaponComponent -> Auto Fire Enabled is true
  2. Weapon Data Asset is added to Starting Weapons or acquired through level-up
  3. Weapon cooldown is not too high
  4. Weapon has a valid ActorClass if required
  5. There is a valid target in range
  6. If Only Fire When Target Available is true, the weapon waits until a valid target exists
  7. If per-weapon targeting is enabled, the target must match the weapon's class/tag filters

Weapon Fires But Hits Wrong Actors

Check:

  1. Override Targeting Settings is enabled
  2. Targetable Tags or Targetable Classes are configured correctly
  3. Target Unspecified Actors is false for strict filtering
  4. The actor does not accidentally have an unwanted tag
  5. The weapon actor is receiving the correct damage filter

BossKiller Does Not Fire

Check:

  1. Boss actor has the Boss tag
  2. Weapon has Override Targeting Settings -> true
  3. Weapon has Targetable Tags -> Boss
  4. Target Unspecified Actors -> false
  5. Boss is inside targeting range
  6. Weapon cooldown is ready

Weapon Hits Normal Enemies Even Though It Is Boss-Only

Check:

  1. Normal enemies do not have the Boss tag
  2. Boss-only weapon has Target Unspecified Actors -> false
  3. Weapon actor supports damage filtering
  4. The weapon was spawned with the correct per-weapon targeting settings

Enemies Are Not Found

Check:

  1. Enemy actors have the expected tag, usually Enemy
  2. Production enemies using URFEnemyLogicComponent have:
    Auto Add Enemy Tag -> true
    Auto Enemy Tag -> Enemy
    
  3. Targeting range is large enough
  4. Enemy has URFHealthComponent
  5. Enemy collision is valid for the weapon type

Completed Features

  • 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

Notes

  • Use AURFTestPlayer for quick prototypes only.
  • For production, add URFWeaponComponent to your own ACharacter or APawn.
  • Use tags such as Enemy, Boss, Door, or Breakable for clear targeting rules.
  • Use Only Fire When Target Available for special-purpose weapons.
  • Keep Target Unspecified Actors false when you need strict filtering.

Clone this wiki locally