Example of vectors and trace nodes

Let's do an example to see the use of vectors and trace nodes. We will modify the Player Character to use a line trace to find and toggle the light of another Blueprint:

  1. Create a new project using the First Person template with starter content.
  2. Open the FirstPersonCharacter Blueprint, which is located in the /FirstPersonBP/Blueprints folder.
  1. In the My Blueprint panel, create a new Macro and name it Trace Locations. In the Details panel, add two output parameters of the Vector type. Name the parameters Start Location and End Location, as shown in the next screenshot. We do not need input parameters:

Get Blueprints Visual Scripting for Unreal Engine - Second Edition 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.