Understanding collision components
In UE5, two types of components can affect and be affected by collision; they are as follows:
- Meshes
- Shape objects
Meshes can be as simple as a cube, or as complex as a high-resolution character with tens of thousands of vertices. A mesh’s collision can be specified with a custom file imported alongside the mesh into UE5 (which is outside the scope of this book), or it can be calculated automatically by UE5 and customized by you.
It is generally a good practice to keep the collision mesh as simple (for example, a few triangles) as possible so that the physics engine can efficiently calculate collision at runtime. The types of meshes that can have collision are as follows:
- Static Meshes: Meshes that are defined as static and do not change.
- Skeletal Meshes: Meshes that can have a skeleton and change their poses, which allows them to be animated. Character meshes, for instance, are skeletal meshes.
- Procedural...