Collision – preventing interpenetration using Block

Blocking means that the Actor components will be prevented from interpenetration in the engine, and any collision between two primitive shapes will be resolved, and not overlapping, after collisions are found.

Getting ready

Begin with a UE4 project that has some objects with Actors having collision primitives attached to them (SphereComponents, CapsuleComponents, or BoxComponents).

How to do it...

  1. Open the Blueprint of an actor that you want to block another actor with. For example, we want the Player actor to block other Player actor instances.
  2. Mark primitives inside the actor that you do not want interpenetrating with other components as Blocking those components in the Details pane.

How it works… ...

Get Unreal Engine 4 Scripting with C++ Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.