Inheritance in Blueprints or Child Blueprints and Root classes, Example

Video thumbnail

I want to present a crucial detail involving the Root and Mesh components within a Blueprint, especially when using movement nodes like Move Component To. This concept is vital for understanding relative and global movement.

1. The Movement Problem (Global vs. Relative)

Previously, I had shown a platform that moves correctly from point A to point B, based on the position assigned to it via a 3D Widget.

The Error of Connecting to the Default Scene Root

  • Modification Attempt: When modifying the Blueprint to directly use the movement node on the Default Scene Root (the Blueprint's root), unexpected behavior occurs.
  • Result: The platform moves to the world origin $(0, 0, 0)$ instead of going to the defined point B.

2. The Hierarchy and Relative Position

The cause of this error lies in the component hierarchy and how relative positions are interpreted:

Component    Role in the Blueprint    Relative Position Reference
Default Scene Root    The Parent Component or the Actor's Root.    Its relative position is the Global World.
Platform Mesh    The Child Component (the visible box).    Its relative position is the Default Scene Root.

The Difference is the Connection:

  1. Incorrect Connection (to the Root): If we connect the movement node to the Default Scene Root, and indicate that the initial position is 0, 0, 0, for the Root, that zero is the world origin. That's why the Blueprint teleports.
  2. Correct Connection (to the Mesh): If we connect the movement node to the Platform Mesh, the 0, 0, 0 position we define is interpreted as the Mesh's initial position relative to its parent (the Root). Since the Mesh is nested under the Root, the movement works correctly relative to the Blueprint's position in the level.
  3. Conclusion: It is essential to pay attention to the component to which the movement is applied. When using the relative position, we must direct the movement to the Child component (the Mesh) so that the Blueprint moves from its location in the level as expected.

I agree to receive announcements of interest about this Blog.

We will learn how we can tie or specify that a Blueprint is a child of another Blueprint

| 👤 Andrés Cruz

🇪🇸 En español