CHAPTER 08
Intermediate
Physics and Collision Systems
Updated: May 16, 2026
25 min read
# CHAPTER 8
Physics and Collision Systems
1. Introduction
A video game world is an illusion. The computer doesn't naturally know that a brick wall is solid. If you don't explicitly tell the engine to calculate mathematics, the player will walk straight through the wall and fall into infinite digital space. The system that calculates gravity, mass, solid boundaries, and bouncing is the Physics and Collision Engine. In this chapter, we will master the invisible walls that define our game worlds. We will explore Collision Channels (determining who can touch what), set up Trigger boxes for interactive events, and unleash chaos with simulated Ragdoll physics.2. Learning Objectives
By the end of this chapter, you will be able to:- Understand the difference between "Collision" and "Physics Simulation."
- Configure Collision Presets (Block, Overlap, Ignore).
- Utilize Custom Collision Channels (e.g., separating "Player" from "Enemy").
- Create and script Trigger Volumes (invisible tripwires).
- Enable physics simulation and Ragdolls on Skeletal Meshes.
3. Collision vs. Physics
- Collision: The math that stops two objects from phasing through each other. (e.g., A player walks into a stone wall and stops). The wall is completely static; it just blocks the player.
- Physics Simulation: The math that calculates gravity, mass, and velocity. (e.g., A player kicks a wooden crate, and the crate tumbles down a hill). The object is dynamic and controlled by the physics engine.
4. The Collision Matrix (Block, Overlap, Ignore)
Every object in Unreal Engine belongs to an "Object Type" (e.g., WorldStatic, Pawn, PhysicsBody). For every single type of object it encounters, it has three options:- 1. Block: Acts as a solid wall. The objects stop each other.
- 2. Overlap: The objects pass through each other like ghosts, but the engine fires an "Event" (like a tripwire) so you can trigger code.
- 3. Ignore: The objects pass through each other, and the engine does absolutely nothing (saves processing power).
5. Trigger Volumes (The Invisible Switches)
A massive part of game design relies on Overlap Events.- The Setup: You place an invisible Box Collision Component in a doorway. You set its collision to "Overlap" for the "Pawn" (Player) object type.
-
The Code: In Blueprints, you use the
Event ActorBeginOverlapnode. When the player walks through the invisible box, the code fires: "If overlapped by Player -> Open the Door."
6. Simulating Physics and Ragdolls
Turning on physics is as simple as checking a box, but it has profound effects.- Static Meshes (Boxes/Rocks): Select a crate mesh in the Details panel and check the box Simulate Physics. If it is floating in the air, it will immediately fall to the ground and bounce when you hit Play. You can adjust its "Mass in KG" to make it heavier to push.
-
Skeletal Meshes (Characters): Characters are usually controlled by animations, not physics. However, when a character dies, you want them to collapse realistically. You trigger a command called
Set Simulate Physicson their skeleton. This instantly disables the animation and turns the character into a floppy Ragdoll, driven entirely by gravity and joint constraints.
7. Visual Learning: Collision Matrix Logic
txt
8. Best Practices
- Custom Collision Channels: Do not rely only on the default channels. Go to Project Settings -> Collision and create a custom Trace Channel called "Weapon". Now you can tell your bullets to "Block" enemies, but "Ignore" tall grass, ensuring you don't waste CPU calculating collisions with leaves.
9. Common Mistakes
- Complex Collision on Moving Objects: If you import a complex chair model with 5,000 polygons, the engine will try to calculate a collision box for every single polygon. This destroys performance. Always use "Simple Collision" (a basic, invisible box or capsule shape) wrapped around the complex visual model.
10. Mini Project: The Deadly Trapdoor
Objective: Use overlaps and physics to create a trap.-
1.
Build a bridge using floor tiles. Make one specific tile a Blueprint Actor (
BPTrapdoor).
-
2.
Inside
BPTrapdoor, the floor mesh is the Root. Add an invisible Box Collision sitting just above the floor tile.
- 3. Set the Box Collision to "Overlap All".
- 4. Set the Floor Mesh to Simulate Physics: OFF.
- 5. In the Event Graph, right-click the Box Collision -> Add OnComponentBeginOverlap.
-
6.
Wire that event to a node:
Set Simulate Physics(Target: Floor Mesh) and check the "Simulate" box to True.
- 7. *Result:* The floor is completely solid until the player walks on the invisible box. The overlap event fires, physics turns on, gravity takes over, and the floor tile immediately falls out from under the player!
11. Practice Exercises
- 1. Define the difference between "Block", "Overlap", and "Ignore" collision responses.
- 2. Explain the concept of a "Ragdoll" in video games and how it differs from a death animation.
12. MCQs with Answers
Question 1
A Level Designer wants an alarm to sound when a player walks into a restricted hallway. What is the most efficient way to detect the player's presence?
Question 2
Why is it a bad idea to use "Complex Collision" (per-polygon collision) on an object that simulates physics and bounces around the level?
13. Interview Questions
- Q: A projectile in your game is passing straight through enemies without doing damage. Walk me through the Collision Matrix settings you would check to debug this issue.
- Q: Explain the difference between Collision and Physics Simulation in Unreal Engine. Can an object have Collision without simulating physics?
- Q: How do you optimize collision meshes for high-poly AAA assets to maintain 60 FPS?