Exploring the Event Graph panel

By default, Event Graph opens with three unlinked Event nodes that are currently unused. An Event refers to an Action in the game that acts as a trigger for a Blueprint to do something. Most of the Blueprints you will create follow this structure: Event (when) | Conditionals (if) | Actions (do). This can be worded as follows: when something happens, check whether X, Y, and Z are true. If so, do this sequence of Actions. A real-world example of this might be a Blueprint that determines whether or not the player can fire a gun. The flow is like this: WHEN the trigger is pulled, IF there is ammo left in the gun, DO fire the gun.

The three Event nodes that are present in our graph by default are three of the most commonly used Event triggers. Event BeginPlay triggers Actions when the player first begins playing the game. Event ActorBeginOverlap triggers Actions when another Actor begins touching or overlapping the space containing the existing Actor that is controlled by the Blueprint. Event Tick triggers the attached Actions every time a new frame of visual content is displayed on the screen during gameplay. The number of frames shown on the screen within a second vary depending on the power of the computer running the game, and this, in turn, affects how often Event Tick triggers the Actions:

We want to trigger a change Material Action on our target every time a projectile hits it. While we could do this by utilizing the Event ActorBeginOverlap node to detect when a projectile object overlaps with the Cylinder Mesh of our target, let's simplify things by only detecting instances when another Actor hits our target Actor. Let's start with a clean slate, by clicking and dragging a selection box over all the default Events and hitting the Delete key on the keyboard to delete them.

..................Content has been hidden....................

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