Firing Projectiles in UE5: Spawn Actor and Projectile Movement Basics

Created: 2026-07-20Last updated: 2026-09-05

An introduction to firing on left click, hitting a box, and reducing its HP. Illustrates spawning with Spawn Actor, movement with Projectile Movement, and cleanup via collision and lifespan, one role at a time.

Press a button, a projectile flies, hits a box, and disappears. This is easier to build when split into three parts: spawning it, flying it, and handling what happens on impact .

Spawning is Spawn Actor from Class and flying is the Projectile Movement Component . This article builds up to firing a white sphere on left click and dealing 20 damage to a target box. We also make missed projectiles disappear after three seconds.

The three roles of spawning, flying, and handling hits and cleanup

What You'll Learn

  • The kind of Actor to build and how to specify spawn position and rotation
  • Splitting collision, visuals, and movement across components
  • Firing on left click and reducing the hit box's HP
  • Checking why a spawn fails and cleaning up missed projectiles

Sponsored

Spawn Actor creates Actors at runtime

Dragging a box into a level is pre-play placement. Firing a projectile mid-game, or dropping an item where an enemy fell, creates a new Actor at that moment. That creation is called spawning .

Spawn Actor from Class starts by deciding "what" and "where to put it".

Input / outputWhat it decides
ClassThe kind of Actor to create. Here, the projectile Blueprint Class
Spawn TransformWhere to create it, plus rotation and scale
Collision Handling OverrideWhat to do when the spawn location overlaps something
Return ValueA reference for addressing the created Actor afterwards

Class is the kind, and Return Value points at the one you just created. Firing ten from the same projectile Class produces ten separate projectiles in the level.

A Transform bundles Location, Rotation, and Scale. For a projectile that means "put it at the muzzle, facing the firing direction, at normal size".

Spawning separate Actors from the same Class and Transform, with Return Value naming this one

The created Actor begins running the logic written in its own Blueprint. Having the firing character handle spawning while the projectile owns its movement and disappearance keeps the roles easy to follow.

Owner and Instigator record who fired it

Spawn Actor's detail pins include Owner and Instigator. Owner is the Actor recorded as the owner and Instigator is the Pawn that caused the action. A Pawn is the kind of Actor controlled by a player or AI, Characters included.

Here we pass the firing BP_InputPractice into both. The Controller operating the shooter is the Actor handling player input or AI. Later damage logic pulls that Controller from the Instigator and passes it along.

Note, though, that setting Owner and Instigator alone does not make the shooter immune or award score. Hit detection and scoring are built separately.

The relationship between the Controller-driven shooter and the projectile carrying Owner and Instigator

Projectile Movement handles flying

Spawn Actor produces the projectile, but that alone does not make it fly. Adding a Projectile Movement Component to the projectile's Blueprint updates its position according to speed and gravity. A projectile is a bullet or thrown object.

Start with these four items.

ItemMeaningValue here
Initial SpeedSpeed at launch, in cm/s1000
Max SpeedSpeed cap. 0 means no cap1000
Projectile Gravity ScaleGravity multiplier on the projectile. 0 is none0
Should BounceWhether it bounces on impactOff

1000 cm/s covers 10 m in one second. Start with a speed where you can see it fly, tying the motion to the settings.

Direction uses Velocity , a vector of X, Y, and Z representing heading and speed. With a positive Initial Speed, Velocity is used as the direction and the speed is matched to Initial Speed. Even with Initial Speed at 0, Velocity carrying speed still moves it, so "0 always means stationary" is not a rule.

Here we set Velocity to (1, 0, 0) and turn on Initial Velocity in Local Space. Local Space means "a direction relative to that Actor itself". With that combination it flies along local +X, the projectile's forward. Changing the projectile's Rotation at spawn also changes the firing direction.

Put the collision component at the top

The projectile Blueprint uses these three components.

ComponentRole
Sphere CollisionSpherical collision. Make it the Root
Static MeshThe visible sphere. A child of the Sphere
Projectile MovementMoves the Sphere

The Root is the component that anchors the whole Actor's position. Projectile Movement normally moves that Root. The Sweep that checks the path during movement uses the moving component's collision, so it matters not to make a visual-only component the Root.

The visual Mesh moves along attached to the Sphere. We disable the Mesh's Collision here and consolidate detection in the spherical Sphere. Projectile Movement is a movement component with no visuals, so its role differs from the solid components placed under the Sphere.

Making the Sphere the Root, the Body its child, and moving it with Projectile Movement

Preparation: shoot a box with a white sphere

We use BP_InputPractice from the Enhanced Input introduction and BP_Damageable from the health and damage introduction. The player is a white box and the target is a box with 100 HP.

Set the flat floor's top surface to Z=0 and place PlayerStart at Location=(0, 0, 100), Rotation=(0, 0, 0). Spawn BP_InputPractice from the same GameMode and get WASD movement working. This exercise keeps facing fixed, so left click fires toward +X, the body's forward.

Practice firing a sphere spawned 100 cm ahead at a box 6 m from the start position

1. Place a target with HP

Set BP_Damageable's DamageMesh to the standard Cube with relative Location and Rotation at 0 and relative Scale at (1.5, 1.5, 2). Collision Presets is BlockAll and Simulate Physics is off.

Place one in the level with Actor Location=(600, 0, 100), Rotation=(0, 0, 0), and Scale=(1, 1, 1). That gives a 150 cm wide, 200 cm tall target 6 m in front of the player.

Use the basic logic built in the health article.

  • MaxHealth is 100, copied into CurrentHealth on BeginPlay.
  • Event AnyDamage subtracts the received Damage from CurrentHealth.
  • Clamp between 0 and MaxHealth and display the remaining HP with Print String.
  • Destroy Actor removes the target when HP reaches 0.

Can Be Damaged in Class Defaults is on. If you added invulnerability time from the health article's extension example, space your shots beyond that window. Rapid fire only reflects the damage that was accepted.

2. Build the projectile Blueprint

Create a Blueprint Class with Actor as the parent and name it BP_ProjectilePractice .

  1. Add a Sphere Collision and drag it onto DefaultSceneRoot to make it the Root. Name it Sphere, with Sphere Radius 10 and Scale (1, 1, 1).
  2. Add a Static Mesh as the Sphere's child and name it Body. Specify the Sphere mesh from Engine/BasicShapes. If you cannot find it, enable engine content display in the asset picker.
  3. Set Body's relative Location and Rotation to 0, Scale to (0.2, 0.2, 0.2), and Collision Presets to NoCollision.
  4. Add Projectile Movement.

The standard Sphere mesh is 100 cm across, so 0.2 scale makes it 20 cm. That matches the 10 cm radius collision to the visible size.

Set the Sphere's Mobility to Movable and leave Simulate Physics off. We fly it with Projectile Movement here. Turning on Simulate Physics hands movement to the physics simulation, which we do not mix with this exercise's settings.

Change the Sphere's Collision Presets from BlockAllDynamic to Custom with these values.

ItemValue
Collision EnabledQuery Only
Object TypeWorldDynamic
Response to WorldStaticBlock
Response to WorldDynamicBlock
Response to PawnIgnore

Query Only enables the queries that check collisions during movement. WorldStatic is used for immovable geometry and WorldDynamic for moving Actors. Block stops against the other party and Ignore passes through.

With these settings it hits the floor and the target while ignoring you, a Pawn. Enemies are Pawns too and would also be ignored , so this is a box-shooting exercise. To distinguish yourself from enemies, continue to the custom channel article.

3. Set how it flies and how long it lives

Select Projectile Movement and match these settings.

ItemValue
Velocity(1, 0, 0)
Initial Velocity in Local SpaceOn
Initial Speed / Max SpeedBoth 1000
Projectile Gravity Scale0
Should BounceOff
Sweep Collision / Auto ActivateBoth on

Sweep Collision checks collisions along the path toward the destination, not just at the destination. Auto Activate is on so the projectile starts moving.

Set Initial Life Span to 3 in Class Defaults. Life Span is the lifetime; three seconds after spawning, the projectile is destroyed automatically. This keeps projectiles that flew off without hitting anything from lingering in the level. 0 means "do not auto-destroy by lifetime".

Compile and save. You now have a projectile type that flies forward when spawned and disappears after three seconds.

Sponsored

The firing side: pass position and rotation and spawn

Next we fire from BP_InputPractice. The logic on the firing side is just input and spawning.

1. Build the left-click input

Create the Input Action IA_FireProjectile with Value Type Digital (Bool) and empty Modifiers and Triggers. Add it to the existing IMC_PlayerControls' Mappings and assign Left Mouse Button.

Place IA_FireProjectile in BP_InputPractice's event graph and wire a white line from Started into Spawn Actor from Class. Class is BP_ProjectilePractice. With Started, one shot fires the moment you press.

Wiring IA_FireProjectile's Started into Spawn Actor's exec input

2. Spawn 100 cm in front of the body

Spawning the projectile at the body's center makes it overlap visually and hard to confirm. We use 100 cm in front of the body's center as a stand-in for a muzzle.

Spawn location = my location + my forward vector × 100

Get Actor Location and Get Actor Forward Vector both take self as Target. Get Actor Forward Vector returns a forward direction of length 1. Multiplying that by 100 as a Float, the numeric type handling decimals, gives a 100 cm forward offset. Add that result to the Actor Location.

Multiplying the forward vector by 100 and adding it to the current location to compute the spawn position

Right-clicking the Spawn Transform pin and choosing "Split Struct Pin" lets you connect Location, Rotation, and Scale separately.

Spawn inputConnection / value
Spawn Transform LocationThe Add result above
Spawn Transform RotationGet Actor Rotation (Target=self)
Spawn Transform Scale(1, 1, 1)
Collision Handling OverrideDo Not Spawn
OwnerSelf
InstigatorSelf

Self here is the firing BP_InputPractice. The projectile flies along its own +X, so passing the character's Rotation aligns the firing direction with the body's facing.

3. Confirm it spawned

From Spawn Actor's Return Value, create the Is Valid with a white exec pin and connect it into Input Object. Wire Spawn Actor's white exec output into Is Valid too.

Is Valid checks whether the reference points at a usable Actor. Wire only the Is Not Valid side into Print String, showing "Could not spawn" for two seconds. The Is Valid side can stay unconnected at this stage. The spawned projectile starts flying via its own Projectile Movement.

Passing Spawn's exec output and Return Value into Is Valid and displaying only on failure

Compile and Play, then click the screen to hand input to the game. Confirm the next left click sends a white sphere forward. Test with the normal movement IMC; do not use the F key mode switch.

There is no damage logic yet. This stage is done when the sphere stops on hitting the target and disappears three seconds after spawning.

The projectile side: damage whatever stopped it

Finally, build post-impact logic into BP_ProjectilePractice. Select Projectile Movement and add On Projectile Stop from the events in the Details panel.

This is the event for Projectile Movement's motion stopping. Should Bounce is off here, so it stops on hitting something that Blocks. The event's Hit Result is data bundling the other party and the impact location.

1. Branch on whether there is a target

Create Break Hit Result from On Projectile Stop's Hit Result to split the bundled information into individual outputs. Hit Actor is what it struck. From that output, create the Is Valid that returns a Boolean (true/false). That is the form without a white exec pin.

Wire On Projectile Stop's white exec output into a Branch and Is Valid's Boolean output into Condition. This branch passes damage only when there is information about the target .

Extracting the target from the stop event's Hit Result and branching on Is Valid's result

2. Deal 20 damage and destroy the projectile

Wire the Branch's True into Apply Damage and specify the following.

Apply Damage inputConnection / value
Damaged ActorBreak Hit Result's Hit Actor
Base Damage20
Event InstigatorGet Instigator Controller (Target=self)
Damage CauserSelf

Self here is the projectile's BP_ProjectilePractice . It points at a different Actor than the firing side's Self.

Get Instigator Controller retrieves the Controller operating the Pawn passed into Instigator at spawn time. Apply Damage's Event Instigator takes a Controller rather than a Pawn, so this node sits in between. Damage Causer takes the projectile that actually hit.

Dealing 20 damage to the target, specifying the shooter's Controller and the projectile itself, then destroying it

Wire Apply Damage's exec output into Destroy Actor (Target=self). Wire the Branch's False side into the same Destroy Actor so the projectile disappears even without target information.

Wiring the Branch's False output into Destroy Actor's exec input to destroy the projectile itself

Walls and floors are valid Actors too. Hitting a wall does not send it down False. Calling Apply Damage from True does not break the target like the box unless it has logic reducing HP.

Destroying a hitting projectile on the spot and a missed one three seconds after spawning

3. Confirm the target's HP and missed projectiles

Play and fire from the start position. Confirm the sphere hits the target and disappears while the target's HP drops 100 → 80 → 60. Five accepted hits bring HP to 0 and the target disappears.

Next strafe with A or D and fire, watching a sphere that missed disappear after three seconds. Flying straight without hitting anything at 1000 cm/s for three seconds covers about 30 m from the spawn point. Use somewhere with no obstacles that far out to check the lifetime.

Sponsored

When it will not spawn, check the overlap

When "Could not spawn" appears, revisit the Class and spawn location. Near walls especially, check whether the spawned sphere's collision is inside the wall.

The difference between Do Not Spawn and Always Spawn when the wall and spawn location overlap

Collision Handling Override chooses what to do when something blocking sits at the spawn location.

SettingWhen the location is occupied
DefaultFollows the Class's setting
Always Spawn, Ignore CollisionsDoes not cancel the spawn over a collision
Try To Adjust Location, But Always SpawnTries to find free space and spawns even if none is found
Try To Adjust Location, Don't Spawn If Still CollidingTries to adjust and does not spawn if it cannot be resolved
Do Not SpawnDoes not spawn if the specified location collides

We use Do Not Spawn here and display that it failed. Changing to Always Spawn does not automatically resolve the wall overlap or disable collisions after spawning.

Offsetting in front of the body is not a universal muzzle fix for every wall either. A thin wall between the body and the spawn location can put the projectile on the far side. A production weapon confirms the muzzle position and whether a wall blocks the path to it.

Try changing gravity and bouncing

With a straight-flying projectile working, the same mechanism lets you compare flight paths. To keep the original, right-click BP_ProjectilePractice in the Content Browser, create a child Blueprint Class, and name it BP_BouncePractice . A child is a kind that inherits the original's components and logic.

How initial direction, gravity, and bouncing settings change the flight path

Change only the child's Projectile Movement to these values.

ItemValue
Velocity(1, 0, 0.5)
Initial Speed700
Max Speed1000
Projectile Gravity Scale1
Should BounceOn
Bounciness0.6
Friction0.2

Making Velocity's Z positive fires it slightly upward. Gravity then acts on it, producing an arc that rises and falls. Bounciness is how strongly it rebounds and Friction is the friction weakening motion along a contacted surface.

Change the firing side's Spawn Class to BP_BouncePractice, strafe away from the target, and fire over a wide floor. Watch it fly up, hit the floor, and bounce. It inherits the original Initial Life Span=3, so it disappears after three seconds even mid-motion.

On Projectile Stop is not an event for every bounce. With Should Bounce on, it is called in cases such as the speed dropping to the stop threshold. A setup that Destroys immediately on On Component Hit disappears at the first impact , so match your cleanup timing when testing bounces.

This is a flight comparison, not a finished exploding grenade. Return Spawn Class to BP_ProjectilePractice after checking.

Choosing against Line Trace, and common stumbles

Line Trace checks what is along a line at the moment of the call. Our projectile changes position while the Actor flies and checks collisions along that path.

That gives you a way to choose: Line Trace for gunfire that resolves hits instantly, and a Projectile when travel time or mid-flight bounces are part of the gameplay. You can also draw a glowing tracer from a Line Trace's result, so visuals alone need not decide it.

Line Trace checks hits at the moment of the call while a Projectile checks while flying
SymptomWhere to check
Left click does nothingThe IA assignment, whether the IMC is active, the exec line from Started
"Could not spawn" appearsClass, spawn location, Collision Handling
The sphere spawns but does not flyWhether Projectile Movement is enabled, the speed, whether the Sphere is the Root
It goes a different way than intendedVelocity, Local Space, the Rotation passed into Spawn
It passes through the targetThe Sphere's and target's Collision, Sweep Collision, the moved component
It hits but HP does not dropOn Projectile Stop, Apply Damage's target, the target's AnyDamage logic and invulnerability window
It disappears before bouncingWhether you Destroy immediately on Hit, whether it reached its lifetime

Distinguish collisions from Projectile Movement's Sweep from collisions from the physics simulation. Simulation Generates Hit Events is the setting for receiving Hit notifications from the physics simulation and is not required to make our On Projectile Stop work.

When a fast projectile passes through, check collision, Sweep, and the moved component first. Sweep checks the path during movement, so reasoning only from "one frame's travel exceeded the wall's thickness" misidentifies the cause.

Bonus: good to know up front

  • Projectiles that hit you : putting the spawn location inside the shooter makes it hit you the moment it appears. Spawn slightly forward from a muzzle socket and add a setting that ignores the shooter
  • Check Collision Handling Override : leaving it unset can prevent a spawn at an overlapping location or, conversely, spawn it into multiple collisions. Choose to suit the projectile's purpose
  • Projectile Movement alone does not fly : it needs Collision and initial speed settings. Always set a lifespan too so missed projectiles do not linger in the level
  • Revisit as the count grows : dozens of simultaneous projectiles put pressure on both collision and rendering

Summary

The firing character decides the projectile's class, position, and rotation and spawns it. The projectile flies with Projectile Movement, passes damage to whatever stopped it, and disappears. When it misses, Life Span handles cleanup.

Start by confirming one shot spawning, stopping at the target, reducing HP, and disappearing on a miss. Adding one moving part at a time also shows what to change when extending to magic bolts or thrown tools.

Reference: Spawn Actor from Class, Projectile Movement Component, Initial velocity and movement settings, Get Instigator Controller, Set Life Span, On Component Hit.

Unreal Engine Notes in this section98