Traces

Traces are used to test whether there are collisions along a defined line segment. A trace can be done by channel or by object type, and can return the single or multiple objects that have been hit.

The channels available are Visibility and Camera. The object type can be WorldStatic, WorldDynamic, Pawn, PhysicsBody, Vehicle, Destructible, or Projectile.

The next screenshot shows the collision responses of a Static Mesh Actor. There are Collision Presets that can be selected, such as BlockAll, OverlapAllDynamic, and Pawn. Or, you can choose Custom… as Collision Presets and define the Collision Responses properties individually. The object type is set via the Object Type property dropdown, while the Visibility and Camera channels are defined in the Trace Responses section of the Collision Responses table:

When a trace Function collides with something, it returns one or more Hit Result structures. The Break Hit Result node can be used to access the Hit Result variables, as seen in the following screenshot:

These are some of the variables of the Hit Result structure:

  • Blocking Hit: A Boolean value that indicates whether the trace hit something
  • Location: The location of the hit
  • Normal: The normal vector that is perpendicular to the surface that was hit
  • Hit Actor: The reference to the Actor hit by the trace
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset