Tutorial — Weapon with the Fire Component
Goal: give a character a weapon that fires Mass projectiles with a fire rate, spread and pellets, and that works unchanged in single-player and multiplayer.
Time: 15 minutes.
The Mass Projectile Fire component (UMassProjectileFireComponent) wraps the spawn call with:
- a fire-rate accumulator (
Consume Fire Rounds), - muzzle, pellet and spread settings,
- client prediction + a compact, validated server RPC when the owner is replicated,
- a preload of its projectile type on BeginPlay, so the first shot does not hitch.
Part A — Minimal automatic weapon
Step 1 — Add the component
Open your Character Blueprint → Components → Add → search Mass Projectile Fire.

| Property | Example | Description |
|---|---|---|
| Projectile Type | EC_Projectile_Rifle |
The type asset this component fires. Can be changed at runtime. |
| Rounds Per Minute | 600 | Used by Consume Fire Rounds. |
| Muzzle Offset | (150, 0, 0) | Offset from the owner in actor space, used by Fire (not Fire From). |
| Pellets Per Shot | 1 | Projectiles per round (shotgun = 8–12). |
| Spread Half Angle Deg | 0 | Random cone per projectile. |
Leave Component Replicates ticked for multiplayer.
Step 2 — Trigger logic
In the Event Graph:
- Fire Pressed →
MassProjectileFire→ Reset Fire Accumulator → Fire (Rounds = 1) → setbFiring = true. - Fire Released → set
bFiring = false. - Event Tick → Branch
bFiring→MassProjectileFire→ Consume Fire Rounds (Delta Seconds) → if Return Value > 0 → Fire (Rounds = Return Value).
That's a complete automatic weapon. Fire aims along the controller's control rotation from Actor Location + Muzzle Offset.
Step 3 — Aim from the camera or a muzzle socket
Replace Fire with Fire From, which takes an explicit world Origin and Direction:
- First-person: Origin = camera location + forward × 50, Direction = camera forward.
- Third-person: Origin = weapon mesh socket
Muzzle, Direction = (crosshair trace hit − Origin), normalized.
Part B — Real example: the Shooter template
This project's weapons (Epic's First Person template, Shooter variant) were converted to Mass projectiles like this.
1. The component lives on the character, not the weapon. Weapons are swapped at runtime, but the character is the replicated owner that can send server RPCs.
2. The weapon Blueprint finds it on its owner. In BP_ShooterWeaponBase → Fire Bullet: Get Owner → Get Component by Class (Mass Projectile Fire Component) → Cast To MassProjectileFireComponent.

3. It sets the type for this weapon and fires from the muzzle. Each weapon Blueprint has an instance-editable MassProjectileType variable (Rifle → EC_Projectile_Rifle, Pistol → EC_Projectile_Plasma, Grenade Launcher → EC_Projectile_Shell). The weapon Sets the component's Projectile Type and calls Fire From with the bullet spawn location and its forward vector.

4. Only the locally controlled copy fires. The weapon exists on every machine for animation and effects. Fire Bullet checks Is Locally Controlled on the pawn owner before calling the component, so a shot is sent exactly once. The component then handles prediction and the server RPC.
5. Fallback. If the cast fails (a weapon held by an actor without the component), the weapon calls Fire Projectiles directly with a Make Projectile Fire Event.
What the component does in each net mode
| Situation | What happens |
|---|---|
| Standalone | Spawns locally. No RPC. |
| Listen/dedicated server, server-owned pawn (or AI) | Spawns on the server and replicates the fire event to all clients. |
| Client, locally controlled pawn | Predicts the shot locally (no latency) and sends ServerFire with the compact wire event. The server validates and spawns it, then every other client mirrors it. The owner's prediction and the echo are merged, so the shot never appears twice. |
| Type not in Replicated Types | Server: spawns server-only. Client: fires nothing (the log warns once). Add the type to Replicated Types. |
Server-side validation (Project Settings → Networking):
Pellets Per Shot × rounds in one callmust be ≤ Max Net Projectiles Per Fire Event (256), or the client is disconnected. KeepConsume Fire Rounds' Max Rounds This Frame (default 32) × pellets under that limit.- More than Max Net Fire Events Per Second Per Player (200) RPCs per second are dropped.
- Muzzles farther than Max Net Fire Origin Distance Cm (30 m) from the pawn are dropped.
Dropped shots exist only on the firing client, and the log shows ServerFire dropped (<reason>).
Node reference
| Node | Inputs | Notes |
|---|---|---|
| Fire | Rounds | From owner location + Muzzle Offset along the control rotation. |
| Fire From | Origin, Direction, Rounds | Explicit world muzzle. Direction need not be normalized. |
| Consume Fire Rounds | Delta Seconds, Max Rounds This Frame (32) | Returns the whole rounds owed this frame at Rounds Per Minute. |
| Reset Fire Accumulator | — | Call on trigger press so the fire rate restarts cleanly. |
| Set Projectile Type | Soft reference to a type asset | Plain property setter; switch ammo at runtime. |