Spawn Decal at Location and Impact Feedback¶
At a glance
Lives in: Blueprint API / Rendering / Decal -
Target: Gameplay Statics -
Returns: a Decal Component object reference -
Can be None: yes, if the world/material inputs cannot produce a
decal component -
Changes: spawns a projected visual mark; it does not replicate, collide,
or apply damage -
Official docs: Spawn Decal at Location
The one-minute version¶
Spawn Decal at Locationcreates a decal component at a world location and rotation.- Decals are projected surface visuals: bullet holes, scorch marks, footprints, blood splats, paint, impact rings.
- Use
Impact Pointfrom a trace or hit as the location. - Use
Impact Normalto build a rotation that points the decal toward the surface. Life Spanis cleanup time for the decal component.0means no automatic lifespan from that pin.- Decals do not apply damage, create collision, change physical material, or replicate.
What it actually does¶
The node asks Gameplay Statics to create a UDecalComponent in the world using
a decal material, size, transform, and lifespan.
pseudocode of the engine behavior - not engine source
function SpawnDecalAtLocation(World, DecalMaterial, DecalSize, Location,
Rotation, LifeSpan):
if World or DecalMaterial is missing:
return None
DecalComponent = create decal component
DecalComponent material = DecalMaterial
DecalComponent size = DecalSize
DecalComponent world transform = Location/Rotation
if LifeSpan > 0:
schedule cleanup after LifeSpan seconds
return DecalComponent
The return value is the component that was spawned. Most one-shot decals do not need to store it. Store it only if you plan to fade, move, hide, or destroy it manually.
Using Impact Point and Impact Normal¶
Traces and hit events usually give two fields you need:
| Hit field | Use |
|---|---|
| Impact Point | Where the decal should be placed in world space. |
| Impact Normal | Which way the surface faces. Use it to orient the decal projection. |
Common trace pattern:
Line Trace By Channel
-> Branch Return Value
-> Break Hit Result
-> Spawn Decal at Location
Decal Material = M_BulletHole_Decal
Decal Size = (8, 8, 8)
Location = Hit.ImpactPoint
Rotation = Make Rot from Z or Make Rot from X using Hit.ImpactNormal
Life Span = 10
The exact rotation helper depends on how your decal material/axis is authored. If the decal appears sideways or projects away from the wall, the hit point is probably fine and the rotation basis is wrong.
Decal size and material¶
The material must be suitable for decal use. If the material is an ordinary surface material, the decal may not render as expected.
Decal Size is a 3D extent for the projection volume, not "screen pixels."
Beginners often make the size too small or too thin, then assume the spawn
failed. Test with a clearly visible debug material and exaggerated size before
tuning.
For impact marks:
Small bullet hole: (6, 6, 6)
Large scorch mark: (80, 80, 80)
Footprint: authored to match the foot and ground projection
Treat those as project-specific values, not engine rules.
Life Span¶
Life Span controls automatic cleanup for the spawned decal component.
| Life Span | Meaning |
|---|---|
0 |
Do not auto-destroy from this lifespan value. |
> 0 |
Remove the decal component after that many seconds. |
Use lifespans for marks that should not accumulate forever:
Bullet holes -> Life Span 20
Explosion scorch -> Life Span 60
Blood splat in small arena -> maybe longer, but still bounded
Unlimited decals can become clutter and cost. If a mark is purely feedback, give it a cleanup policy.
When it fails¶
| Symptom | Likely cause | Fix shape |
|---|---|---|
Return value is None or nothing appears |
Missing world/material, invalid context, or material unsuitable for decals. | Test with a known decal material from a visible world event. |
| Decal appears in the wrong place | Using Location instead of Impact Point, or using actor location. |
Break the trace/hit result and use surface impact data. |
| Decal points the wrong way | Rotation does not align to Impact Normal. |
Build rotation from the surface normal and test axis orientation. |
| Decal disappears immediately | Very short lifespan or component destroyed with owner/world. | Increase lifespan and inspect cleanup paths. |
| Other clients do not see it | Spawn call ran only locally. | Replicate the impact event/state, then spawn local decals on clients. |
Failure does not apply damage, retry with another material, or log a useful Blueprint warning in normal cases.
What decals do not do¶
- They do not create collision.
- They do not change the surface's physical material.
- They do not apply damage or gameplay effects.
- They do not replicate.
- They do not replace Niagara particles or sounds.
- They do not attach to moving targets when spawned at a fixed world location.
- They do not solve hit detection; they display feedback after hit detection.
The pattern everyone actually uses¶
For a weapon impact:
Input Fire
-> server/client authority pattern for your game
-> Line Trace By Channel
-> Branch Return Value
-> Break Hit Result
-> filter Hit Actor for gameplay
-> Apply Damage if appropriate
-> Spawn Niagara System at Location Hit.ImpactPoint
-> Spawn Decal at Location Hit.ImpactPoint / Hit.ImpactNormal
-> Play Sound at Location Hit.ImpactPoint
For a surface-specific decal:
Trace with physical material enabled
-> Break Hit Result
-> Physical Material / Surface Type
-> Map Surface Type to Decal Material
-> Spawn Decal at Location
The decal is one piece of feedback. Damage, sound, VFX, and surface choice are separate decisions driven by the same hit result.
The C++ twin, for the curious (our own example code):
UDecalComponent* Decal = UGameplayStatics::SpawnDecalAtLocation(
GetWorld(),
ImpactDecalMaterial,
FVector(8.0f, 8.0f, 8.0f),
Hit.ImpactPoint,
Hit.ImpactNormal.Rotation(),
12.0f);
if (IsValid(Decal))
{
Decal->SetFadeScreenSize(0.001f);
}
Lookalikes - which one do I want?¶
| Node/tool | Use when | Watch out |
|---|---|---|
| Spawn Decal at Location | A fixed surface mark should appear at a world transform. | Does not replicate or collide. |
| Spawn Decal Attached | The mark should follow a moving component. | Attach target/socket and relative transform matter. |
| Spawn Niagara System at Location | Particles/simulation should play at impact. | Particles are not projected marks. |
| Set Material / DMI | A mesh surface should change its own material parameters. | Changes the mesh material, not a projected decal. |
| Line Trace By Channel | You need the hit point/normal first. | The trace is detection, not feedback. |
| Physical Material | You need to choose feedback by surface type. | The physical material is data, not the decal itself. |
Rule of thumb: trace/hit decides what happened, physical material chooses the surface flavor, decal displays the mark.
Going deeper¶
- Line Trace By Channel - getting Impact Point and Impact Normal.
- Event Hit - impact data from blocking movement or physics.
- Spawn Niagara System at Location / Attached - particle VFX from the same hit data.
- Physical Materials for surface-specific feedback - choosing decal/sound/VFX by surface type.
- Replication basics - replicating the gameplay event behind local impact feedback.
- Official docs: Spawn Decal at Location, Line Trace By Channel, and Event Hit.
- Engine source (requires engine access - we do not reproduce it here):
UGameplayStatics::SpawnDecalAtLocationinEngine/Source/Runtime/Engine/Private/GameplayStatics.cpp; decal component behavior inUDecalComponentunderEngine/Source/Runtime/Engine/Classes/Components/DecalComponent.h.