Proving Grounds: 3D Platformer Mechanics Support: GitHub issues

15. Call the kit from Blueprint

Goal: call one of the hero's Blueprint nodes from your own Blueprint. Here the Level Blueprint launches the hero straight up when Play starts; every other node of the hero is reached the same way.

You need: Unreal Engine 5.3–5.8 with the plugin enabled (pictures: 5.7), Settings > Plugin Content ticked in the Content Browser (5.3–5.5: Show Plugin Content), and a level that uses the kit's hero, for example the demo map Course1_RunAndJump (Plugins > Proving Grounds: 3D Platformer Mechanics > Maps). Open that level first.

  1. In the level editor toolbar open the Blueprints menu and choose Open Level Blueprint.

Blueprints menu with Open Level Blueprint

  1. Right-click an empty spot of the graph, type Get Player Character and pick it.

Right-click menu searched for Get Player Character

  1. Drag from its Return Value pin, type Cast To CorridorCharacter and pick it. Every hero of the kit is a CorridorCharacter (BP_Character is one), so the cast gives you all of its nodes.

Drag from Return Value, Cast To CorridorCharacter

  1. Drag from the white execution pin of Event BeginPlay to the execution input of the cast.

Event BeginPlay wired to the cast

  1. Drag from As Corridor Character, type Bounce and pick it. The editor wires the cast's execution output to the new node by itself.

Drag from As Corridor Character, Bounce

  1. Click the Velocity box of the Bounce node, type 1500 and press Enter (cm/s upward).

Bounce node with Velocity 1500

  1. Click Compile.

Compile

  1. Close or minimise the Level Blueprint window and click Play in the level editor.

Play button

Result

When Play starts the Level Blueprint launches the hero straight up: with Velocity 1500 its feet reach 4.5 m above the floor (measured: 448 cm at the top of the rise).

Play: the hero at the top of the launch

Close Play and delete the three nodes (or close the level without saving) if you only wanted to try it.

If it doesn't work - Nothing happens: the level's player is not a kit hero, so the cast fails. The demo maps pick the kit hero in World Settings > GameMode Override; with your own character (route A) cast to your character and call the component's nodes instead. - Two entries with the same name in the menu (for example Set Ability Enabled): pick the one under the hero, not the one of the Corridor Hero component. - Nothing happens with Velocity at 0: the default is 0, type a value.

Nodes you reach from the same As Corridor Character pin (full list with inputs and outputs: Blueprint API):

Node Kind What it does
Set Ability Enabled / Is Ability Enabled Function / Getter Switch one move on or off while the game runs (see topic 5).
Get Corridor Action Getter What the hero is doing now (Double Jump, Spin, Grind Rail ...).
Bounce Function Launches the hero up, like a crate: Velocity, or Held Velocity while Jump is held.
Bounce Off Enemy Function Like Bounce, but the double jump stays available.

See also: Blueprint API · Quickstart