Skip to main content

💥 Collision and Physics Interaction

Every game needs to know when things touch. When a player walks into a wall, they should stop. When they step on a button, something should happen. When they enter a room, enemies might wake up. Unreal's collision system handles all of this—determining which objects can pass through each other, which ones block, and which ones generate events when they touch. In this lesson, you'll learn how collision works, how to configure it, and how to respond to collision events in your Blueprints.

🎯 Learning Objectives

By the end of this lesson, you will be able to:

  • Explain how collision channels and presets work in Unreal
  • Configure collision responses: Block, Overlap, and Ignore
  • Create trigger volumes that detect player entry and exit
  • Respond to collision and overlap events in Blueprints
  • Set up basic physics simulation on actors
  • Build a trigger zone that responds to the player

Estimated Time: 50-60 minutes

Prerequisites: Lesson 6.3 (Character Movement)

📑 In This Lesson

Collision Basics

Collision in Unreal determines what happens when two objects try to occupy the same space. Should they stop each other? Pass through? Generate an event? The collision system answers these questions for every pair of objects in your game, every frame.

Collision Components

Collision is handled by collision components—invisible shapes that define an object's physical presence. Common collision components include:

Box Collision: A rectangular box shape. Good for crates, doors, rooms, trigger zones.

Sphere Collision: A spherical shape. Good for pickups, area effects, radial detection.

Capsule Collision: A pill shape (cylinder with hemispherical caps). Used for characters—it's the default collision for the Character class.

Mesh Collision: Collision that matches the shape of a mesh. Can be simple (convex hull) or complex (per-polygon). Complex is expensive but accurate.

Common Collision Shapes Box Crates, doors, zones Sphere Pickups, radial areas Capsule Characters, humanoids Mesh Complex shapes

Figure: Common collision shapes. Simpler shapes are cheaper to compute.

Simple vs. Complex Collision

Static meshes can have two types of collision:

Simple Collision: Basic shapes (boxes, spheres, capsules, or convex hulls) that approximate the mesh. Fast to compute, used for most game objects.

Complex Collision: Uses the actual mesh triangles for collision. Accurate but expensive. Used sparingly for things like terrain or when precise collision is critical.

In the Static Mesh Editor, you can view and add simple collision via the Collision menu. Common options include:

  • Add Box Simplified Collision
  • Add Sphere Simplified Collision
  • Add Capsule Simplified Collision
  • Auto Convex Collision (generates a convex hull)

Collision Enabled Settings

Every component with collision has a Collision Enabled setting that determines what the collision does:

No Collision: Collision is completely disabled. Objects pass through freely. No events generated.

Query Only (No Physics Collision): Generates overlap/touch events but doesn't physically block. Good for triggers.

Physics Only (No Query Collision): Physically blocks but doesn't generate events. Rare use case.

Collision Enabled (Query and Physics): Both blocks and generates events. Default for most objects.

Collision Enabled Settings No Collision Physics: ✗ Events: ✗ Query Only Physics: ✗ Events: ✓ Physics Only Physics: ✓ Events: ✗ Query and Physics Physics: ✓ Events: ✓ Ghosts, visual only Triggers, sensors Invisible barriers Most game objects Query = Events | Physics = Blocking

Figure: Collision Enabled determines whether collision blocks movement and/or generates events.

💡 Query vs. Physics

Query refers to the ability to detect overlaps and generate events. Physics refers to actual physical blocking (preventing objects from passing through). Triggers use "Query Only" because they need to detect the player entering but shouldn't physically block them.

Collision Channels and Presets

Not everything should collide with everything else. Bullets might pass through other bullets but hit characters. The player might pass through pickups but not walls. Unreal uses Collision Channels and Presets to control which objects interact with which.

Object Channels

Object Channels define categories of objects. Unreal provides several built-in channels:

  • WorldStatic: Static level geometry (walls, floors, terrain)
  • WorldDynamic: Movable objects that aren't pawns (doors, platforms)
  • Pawn: Player and AI-controlled characters
  • PhysicsBody: Simulated physics objects
  • Vehicle: Vehicles
  • Destructible: Destructible meshes

You can also create custom channels in Project Settings → Collision for game-specific needs (Projectile, Pickup, InteractiveObject, etc.).

Trace Channels

Trace Channels are used for line traces (raycasts), not object collision. Built-in trace channels:

  • Visibility: For visibility checks (line of sight)
  • Camera: For camera collision/obstruction

Custom trace channels are useful for things like weapon traces that should hit specific object types.

Collision Presets

Rather than configuring collision responses manually for each object, you can use Collision Presets—predefined configurations that set Object Type and responses to all channels at once.

Common built-in presets:

Preset Object Type Behavior
BlockAll WorldStatic Blocks everything
BlockAllDynamic WorldDynamic Blocks everything, movable
OverlapAll WorldDynamic Overlaps everything (trigger)
OverlapAllDynamic WorldDynamic Overlaps everything, movable
Pawn Pawn Character collision
NoCollision WorldStatic No collision at all
Custom... Various Manual configuration
Collision Preset in Details Panel ▼ Collision Collision Preset OverlapAllDynamic ▼ Object Type WorldDynamic Collision Enabled Query Only (No Physics Collision) Select a preset or choose "Custom..." to configure individually

Figure: Collision Preset dropdown in the Details panel provides quick configuration.

Creating Custom Presets

You can create custom collision presets in Project Settings:

  1. Go to Edit → Project Settings → Collision
  2. Scroll to Preset section
  3. Click New... to create a new preset
  4. Name it (e.g., "Pickup", "Projectile", "Trigger")
  5. Set Object Type and responses to each channel

Custom presets appear in the Collision Preset dropdown on all components.

⚠️ Both Objects Matter

Collision is determined by both objects involved. If Object A says "Block Pawn" but Object B (a Pawn) says "Ignore WorldStatic," the result depends on both settings. Generally, if either object says "Ignore," they won't interact. Both must agree to Block for blocking to occur.

Collision Responses: Block, Overlap, Ignore

Each object defines how it responds to each collision channel. The three possible responses are:

Block

Block means the objects cannot pass through each other. Physical collision occurs. This is what you want for walls, floors, solid objects, and characters that shouldn't walk through each other.

When blocking collision occurs:

  • Objects stop at the collision point
  • Physics forces are applied (if simulating)
  • On Hit events fire (if enabled)

Overlap

Overlap means objects can pass through each other, but overlap events are generated. This is perfect for triggers, pickups, damage zones, and detection areas.

When overlap occurs:

  • Objects pass through freely
  • On Begin Overlap fires when overlap starts
  • On End Overlap fires when overlap ends

Ignore

Ignore means no collision interaction at all. Objects pass through each other silently—no physics, no events.

Collision Response Types 🛑 Block Objects stop, On Hit fires 🔄 Overlap Pass through, events fire 👻 Ignore Pass through, no events Use Cases • Walls, floors, terrain • Solid objects • Character collision Use Cases • Triggers, sensors • Pickups, collectibles • Damage zones Use Cases • Visual-only effects • Same-team characters • Projectile-to-projectile

Figure: Block stops objects; Overlap lets them pass but fires events; Ignore does nothing.

Configuring Custom Responses

To set custom responses per channel:

  1. Select the component with collision
  2. In Details panel, find Collision section
  3. Set Collision Preset to Custom...
  4. Expand Collision Responses
  5. Set each channel to Block, Overlap, or Ignore
Custom Collision Response Configuration ▼ Collision Responses Ignore | Overlap | Block WorldStatic WorldDynamic Pawn PhysicsBody ● Block ● Overlap ● Ignore This trigger: Blocks walls, Overlaps pawns, Ignores physics bodies

Figure: Custom collision responses allow fine-grained control per channel.

Generate Overlap Events

For overlap events to fire, you must enable Generate Overlap Events on the component. This is a checkbox in the Collision section of the Details panel.

Both components involved in the overlap need this enabled for events to fire. If either has it disabled, no overlap events occur.

✅ Overlap Checklist

For overlaps to work, ensure:

  1. Collision Enabled includes "Query" (Query Only or Query and Physics)
  2. Generate Overlap Events is checked
  3. Collision Response to the other object's channel is set to Overlap
  4. The other object also has Generate Overlap Events enabled

Hands-On: Create a Trigger Zone

Let's build a practical trigger zone from scratch. We'll create an area that detects when the player enters and exits, displays a message, and demonstrates the one-time trigger pattern. This exercise covers the complete workflow for trigger-based interactions.

🎯 Exercise Goal

Create a trigger zone Blueprint that: detects player entry/exit, displays on-screen messages, changes a light color when entered, and includes a one-time "first visit" message. This covers overlap events, actor identification, and practical trigger patterns.

Step 1: Create the Trigger Blueprint

  1. In Content Browser, right-click → Blueprint Class
  2. Select Actor as the parent class
  3. Name it BP_TriggerZone
  4. Double-click to open the Blueprint Editor

Step 2: Add Components

In the Components panel, add:

  1. Click Add → search for Box Collision → add it
  2. Rename it to TriggerBox
  3. With TriggerBox selected, in Details panel:
    • Set Box Extent to X: 200, Y: 200, Z: 100
    • This creates a 400×400×200 unit trigger area

Add a visual indicator (optional but helpful for testing):

  1. Click AddPoint Light
  2. Rename it to IndicatorLight
  3. In Details, set:
    • Intensity: 5000
    • Light Color: Red (we'll change it to green when triggered)
    • Attenuation Radius: 500
  4. Position it at Z: 150 (above the trigger box)
BP_TriggerZone Component Structure Components 📦 DefaultSceneRoot ├─ 📐 TriggerBox (Box Collision) └─ 💡 IndicatorLight (Point Light) Trigger detects, light indicates In Level (Side View) Trigger Box 💡

Figure: Component hierarchy and visual representation of the trigger zone.

Step 3: Configure Collision

Select the TriggerBox component and configure collision:

  1. In Details panel, find Collision section
  2. Set Collision Preset to OverlapAllDynamic
  3. Verify Generate Overlap Events is checked ☑
  4. Collision Enabled should show "Query Only (No Physics Collision)"

✅ Collision Settings Check

Your TriggerBox collision should show:

  • Collision Preset: OverlapAllDynamic
  • Generate Overlap Events: ☑ Checked
  • Collision Enabled: Query Only

Step 4: Create Variables

In the Variables section of My Blueprint panel, create:

  1. HasBeenVisited — Boolean, default False
    • This tracks if the player has entered before (for one-time message)
  2. PlayerInZone — Boolean, default False
    • This tracks if the player is currently inside

Step 5: Add Overlap Events

Now add the event handlers:

Add Begin Overlap Event:

  1. Select the TriggerBox component
  2. In Details panel, scroll to Events section
  3. Click the + next to On Component Begin Overlap
  4. This adds the event node to your Event Graph

Add End Overlap Event:

  1. With TriggerBox still selected
  2. Click the + next to On Component End Overlap

Step 6: Implement Begin Overlap Logic

Build this logic from the On Component Begin Overlap event:

  1. Drag from Other Actor pin
  2. Add Cast To node → select your character class (e.g., BP_ThirdPersonCharacter)
  3. Connect the execution wire from the event to the Cast node
  4. From the Cast's success execution pin:

Set Player In Zone:

  1. Add Set Player In Zone → set to True

Change Light Color:

  1. Drag the IndicatorLight reference into the graph
  2. Drag from it and add Set Light Color
  3. Set the color to Green (0, 1, 0)

Check First Visit:

  1. Add a Branch node
  2. Get HasBeenVisited variable
  3. Add a NOT Boolean node (so we check if NOT visited)
  4. Connect to Branch condition

On True (First Visit):

  1. Add Print String → "Welcome! This is your first time here."
  2. Add Set HasBeenVisited → True

On False (Repeat Visit):

  1. Add Print String → "Welcome back!"
Begin Overlap Blueprint Logic On Begin Overlap (TriggerBox) Cast To Character Set PlayerInZone = True Set Light Color = Green Branch NOT HasVisited True (First Visit) Print: "Welcome!" Set HasVisited = True T False (Repeat) Print: "Welcome back!" F Logic Flow 1. Cast to verify it's the player → 2. Set state + change light → 3. Check first visit → 4. Show appropriate message

Figure: Complete Begin Overlap logic with first-visit detection.

Step 7: Implement End Overlap Logic

From the On Component End Overlap event:

  1. Cast to your character class (same as before)
  2. On success:
    • Set PlayerInZone to False
    • Set Light Color back to Red
    • Print String: "Goodbye!"

Step 8: Compile and Save

  1. Click Compile in the toolbar
  2. Fix any errors (check wire connections)
  3. Click Save

Step 9: Place in Level and Test

  1. Drag BP_TriggerZone from Content Browser into your level
  2. Position it where the player can walk through
  3. Add a floor if needed (cube scaled to 10×10×0.1)
  4. Press Play

Test the following:

  • Walk into the trigger zone — light turns green, "Welcome!" message appears
  • Walk out — light turns red, "Goodbye!" message appears
  • Walk back in — "Welcome back!" appears (not the first-time message)
  • Repeat exit/entry — always shows "Welcome back!" now

✅ Exercise Complete!

You've built a fully functional trigger zone with:

  • Overlap detection for player entry and exit
  • Actor type verification using Cast
  • Visual feedback (light color change)
  • One-time trigger pattern for first visit
  • State tracking with boolean variables

This pattern applies to loading zones, checkpoints, cutscene triggers, and countless other game mechanics.

Bonus Challenges

  1. Sound Effect: Play a sound when entering/exiting (Add Audio Component, call Play)
  2. UI Message: Instead of Print String, create a UMG widget that displays on screen
  3. Multiple Triggers: Create several instances with different messages using exposed variables
  4. Damage Zone: Apply damage while PlayerInZone is true using a Timer
  5. Collectible: Destroy the trigger after first overlap (one-time pickup)

Troubleshooting

⚠️ Common Issues

Overlap event doesn't fire:

  • Check "Generate Overlap Events" is enabled on BOTH the trigger AND the character's capsule
  • Verify Collision Preset is set to overlap (not block or ignore)
  • Make sure you're testing with the correct character class in the Cast

Cast always fails:

  • The "Other Actor" might not be your character — could be camera, weapon, etc.
  • Double-check the class name in the Cast node matches your actual character Blueprint

Light doesn't change color:

  • Ensure the IndicatorLight variable reference is connected properly
  • Try using "Set Light Color" with a Linear Color (not regular color)

Summary

In this lesson, you've learned how Unreal Engine's collision system works—from basic collision shapes to custom channel configurations to event-driven gameplay. Collision is fundamental to game development, enabling everything from solid walls to pickup items to damage zones.

Key Concepts

Collision Components: Box, Sphere, Capsule, and Mesh collision shapes define an object's physical presence. Simple collision (basic shapes) is fast; complex collision (mesh triangles) is accurate but expensive.

Collision Enabled: Determines what collision does. "Query Only" generates events but doesn't block. "Physics Only" blocks but doesn't generate events. "Query and Physics" does both.

Collision Channels: Categories like WorldStatic, Pawn, and PhysicsBody that organize objects. Each object belongs to a channel and defines how it responds to other channels.

Collision Responses: Block stops objects and fires Hit events. Overlap lets objects pass through and fires Overlap events. Ignore does nothing.

Collision Events: On Begin Overlap fires when overlap starts. On End Overlap fires when it ends. On Hit fires on blocking collision. Use "Other Actor" to identify what collided.

Trigger Volumes: Invisible collision areas that detect entry/exit. Use OverlapAllDynamic preset, enable Generate Overlap Events, and respond in Blueprints.

Collision Quick Reference

Use Case Collision Preset Event
Solid wall/floor BlockAll On Hit (if needed)
Trigger zone OverlapAllDynamic On Begin/End Overlap
Pickup item OverlapAllDynamic On Begin Overlap → Destroy
Physics object PhysicsActor On Hit for impacts
Character Pawn Various as needed

Best Practices

  • Use simple collision: Box, sphere, and capsule are much faster than mesh collision
  • Enable Generate Overlap Events only when needed: It has a performance cost
  • Cast to verify actor type: Don't assume what entered your trigger—always check
  • Use presets when possible: They're optimized and consistent
  • Test both entry and exit: Make sure cleanup logic runs on exit
  • Use flags for one-time triggers: Boolean variables prevent repeat execution
Collision System Overview Object A Channel + Response Object B Channel + Response Collision Resolution Both responses checked → Result determined Block Overlap Ignore

Figure: Collision is resolved by checking both objects' channel settings.

What's Next?

Now that you can detect when players enter areas and collide with objects, the next lesson covers Interactable Objects. You'll learn to create objects the player can interact with using a button press—doors that open, switches that activate, items that can be picked up, and more. This combines collision detection with input handling for rich gameplay interactions.

Knowledge Check

Question 1

What does "Query Only" collision enabled mean?

Correct answer: B — "Query Only" means objects can pass through each other (no physics blocking) but overlap and hit events are still generated. This is perfect for triggers that need to detect the player without stopping them.

Question 2

What collision response should you use for a trigger zone that the player walks through?

Correct answer: C — Overlap allows objects to pass through each other while still generating Begin Overlap and End Overlap events. This lets you detect when the player enters/exits the trigger without blocking their movement.

Question 3

Which parameter in an overlap event tells you what actor entered the trigger zone?

Correct answer: B — "Other Actor" is the actor that caused the overlap (the player, enemy, etc.). "Overlapped Component" is your trigger component. You typically cast "Other Actor" to your character class to verify it's the player.

Question 4

What must be enabled on BOTH components for overlap events to fire?

Correct answer: B — "Generate Overlap Events" must be checked on both components involved in the overlap. If either component has it disabled, no overlap events will fire. This is a common source of "my trigger doesn't work" bugs.

Question 5

How do you make a trigger fire only once (like a first-time tutorial message)?

Correct answer: D — All three approaches work for one-time triggers. Boolean flags are most flexible (trigger stays, just doesn't re-execute logic). Destroying works for pickups. Disabling collision works if you want the actor to remain but stop detecting. Choose based on your specific needs.