Udemy: Unreal Engine 5 Beginner Blueprints: Make your first game!: Moving platforms - jgoffeney/Cesium4Unreal Wiki

Back

This section adds platforms to the game.

Create Materials

GreenGlow

Building Platforms

Creating the Geometry

Creating the Graph

Switch to the graph for the Platform.

Adding Variables

Add four variables via the Variables section to provide configuration for the platforms. As you add them click to the Eye icon at the right to open to make them publicly accessible and editable. After you compile the blueprint you can set the variable default values in their Details.

Programming the Graph

Event BeginPlay

The graph from this node is responsible for initializing the platform to start at the first arrow and set its edge to red if it is not active.

Platform

Adding Pressure Plates

Create a new blueprint Actor called PressurePlate. It is composed of a cube (named Plate) scaled to (2.0, 2.0, 0.1) with a slightly smaller cube (named Glow and parented to Plate) protruding from it with the Red Glow material so it appears there is a button on top. It is red by default but turns green when it is ready to be stepped on. Then add a Box Collision as Box (parented to Plate)and size it to just contain the pressure plate cubes.

Creating the Graph

Switch to the graph for the PressurePlate.

Adding Variables

Programming the Graph

NOTE: for the blueprint below the Branch node was moved after the SetWorldLocation to make sure all platforms will begin at their Point1 location.

PlatformWithCustomEvent

PressurePlateActivate

Adding Sounds

Pressure Plate

The pressure plate will make a sound the first time it is stepped on.

Audio Details

Event Graph

PressurePlateActivateWithSound

Platform

The platform will make a continuous hum unless it is deactivated.

Audio Details

Event Graph

PlatformWithCustomEventAndSound