Event Nodes in Unreal Engine
Event nodes in Unreal Engine are visual scripting nodes used in the Blueprint system to define and trigger specific events in a game.
Event nodes can be thought of as the starting point of a Blueprint script.
Event nodes are typically associated with specific actions, such as player input or collisions with other objects, and are used to trigger various responses and behaviors in the game world.
So let’s talk about “On Component Begin & End Overlap,” one of the most frequently used Event Nodes in Unreal Engine.
On Component Begin & End Overlap Nodes
In Unreal Engine, collision detection is an important feature used to detect when two objects come into contact with each other. The On Component Begin Overlap and On Component End Overlap nodes are part of Unreal Engine collision system and are used to trigger events when two objects overlap or stop overlapping.
Because of this, these 2 event nodes are usually used together:
- On Component Begin Overlap (): The Event is triggered whenever something begins to overlap this component, such as when a player walks into a trigger.
- On Component End Overlap (): The Event is triggered whenever something ends to overlap this component, such as when a player walks out of a trigger.
This nodes are commonly used to trigger events such as playing a sound or spawning an effect when the player enters a trigger volume, open doors, or detecting when a character comes into contact with a weapon. Or to trigger events such as turning off a light or resetting a puzzle when the player leaves a trigger volume.
Output Nodes | On Component Begin/End Overlap
- Overlapped Component (Primitive component object reference): This output gives you a reference to the component that is being overlapped. For example: “BlueprintName.BoxCollisionComponent“.
- Other Actor (Actor object reference): Connect a “Cast To…” Blueprint node to specify which actor you want to trigger the begin and end overlap events. For example, if you only want the player character to trigger the event, you can cast to the player character from the “Other Actor” reference. This means that the event will not be triggered when, for example, the AI character overlaps the object.
- Other Comp (Primitive component object reference): This output gives you a reference to the other component that is being overlapped, like the player collision. For example: “BP_ThirdPersonCharacter_C_0.CollisionCylinder“.
- Other Body Index (Integer): Refers to the index of the specific primitive component of the other actor that the current actor is overlapping with. This is useful when the other actor has multiple primitive components, and you want to know which one is causing the overlap. Note that If the other actor has only one primitive component, the value of the “Other Body Index” output will always be zero.
- From Sweep (Boolean): It returns True or False depending if something is overlapping the collision.
- Sweep Result (Hit result structure): To access many additional outputs, right click and choose “Split Struct Pin“.
How to create “Add OnComponentBeginOverlap”:
- One way to create a On Component Begin Overlap is adding a Box Collision Component inside a Blueprint.
- Then Right-Click “Add Event → Add OnComponentBeginOverlap“.
- Tip: Make sure that “Generate Overlap Events” is set to true, and that you have the correct Collision Presets, such as “Trigger“.
Unreal Engine Examples:
For a practical example of using the On Component Begin and End Overlap events, you can read this tutorial on making a sliding door in Unreal Engine.
This tutorial will show you how to make use of these events to make a door open and close whenever a character or object overlaps with the trigger volume.
Hope This Helps! Keep On Creating!