Changing direction
In this section, we will implement the logic to change the target's direction periodically. This will result in a target that moves back and forth between two points regularly, much like a shooting gallery target:
- Right-click in an empty space of the EventGraph to open the context menu and search for
custom event
. Select the Add Custom Event option. Rename the eventChangeDirection
:
- We are going to invert the Direction vector by multiplying it by
-1
:
- Drag the Direction variable from the My Blueprint panel and drop it into the EventGraph. Choose the Get Direction option to create a node.
- Drag from the output pin of the Direction node and drop it into an empty space. Type an asterisk (
*
) in the search field and select the Multiply node. - The previous step...