1 of 16

Overview, Project Creation and Prep Work

Time Attack Racer

2 of 16

Youtube Video Tutorials

3 of 16

Overview

Blueprint

  • Working with Various Class Blueprints
  • Checkpoint System
  • Save System (Lap/Race)
  • Reusing the System

UMG (Unreal Motion Graphics)

  • HUD/Splash Screen
  • Displaying Information
  • Animating UI Widgets

4 of 16

Project Creation

New Blueprint Project

  • Vehicle Advanced Template
  • With Starter Content
  • Name: LastName_Racer

5 of 16

Project Creation

Create New Folders

  • Audio
  • Blueprints
    • UI (sub folder)��

We will incorporate two sound files into our game. One for background music and one for when you pass through a checkpoint.

We will then create several Blueprints...

Blueprint Class: Actor x 2

  • Name it - Checkpoint
  • Name it - Tracker

Blueprint Class: Player Controller

  • Name it - MyPlayerController

Blueprint Class: Save Game (search for it)

  • Name it - MySavedGame

Blueprints: Blueprint Macro Library: Actor

  • Name it - TimeConversion

User Interface: Widget Blueprint

  • Name it - HUD

6 of 16

Project Creation

Open the VehicleAdv GameMode Blueprint

  • This is found in the VehicleAdvBP folder and then inside the subfolder called Blueprints.
  • Switch the Player Controller Class from the default (PlayerController) to our newly created Blueprint (MyPlayerController)
  • Hit Compile and Save!

7 of 16

Prep Work

Open the MyPlayerController Blueprint...

  • In the MyBlueprint Panel we will create some new Variables
    • ActualLap
    • MaxLaps
      • Type: Integer
      • Category: Value Variables

    • ActualRaceTime
    • ActualLapTime
    • GoldTime
    • SilverTime
    • BronzeTime
    • BestLapTime
    • BestRaceTime
    • DefaultBestLapTime
    • DefaultBestRaceTime
      • Type: Float
      • Category: Value Variables

Tip: With a variable selected, press Control and W to create quick copies of them

8 of 16

Prep Work

In the MyPlayerController Blueprint...

  • Since all the float variables are things we would like to display we will need to create conversions for them to make them readable text formats. Create a new Variable…
    • RaceTimeText
      • Type: Text
      • Category: Text Variables

We will need to create several versions of this type of variable. Use the naming conventions listed below:

    • CurrentLapText
    • MaxLapText
    • GoldTimeText
    • SilverTimeText
    • BronzeTimeText
    • BestTimeText
    • BestLapText
    • NameOfMap
    • ReadyText

Tip: With a variable selected, press Control and W to create quick copies of them

9 of 16

Prep Work

In the MyPlayerController Blueprint...

  • Create new Variables…
    • RaceComplete
    • RaceStart
      • Type: Boolean
    • RespawnLocation
      • Type: Transform
    • SaveSlot
      • Type: String

10 of 16

Prep Work

In the MyPlayerController Blueprint...

  • Compile and Save
  • Set the Default Values for…
    • ActualLap = 1
    • MaxLaps = 3
  • Compile and Save

11 of 16

Prep Work

In the MyPlayerController Blueprint...

  • In the MyBlueprint Panel, create an Event Dispatcher, this will let the player know when the race has been started.
    • Name it - RaceHasStarted

We will also need to create several functions. Use the naming conventions listed below:

    • InitText
    • SaveGameCheck
    • SaveTheGame
    • LoadTheGame
    • LapTimeCheck
    • RaceTimeCheck
    • UpdateGoals

12 of 16

Prep Work

In the MyPlayerController Blueprint...

  • In the EventGraph...
    • Remove EventTick, we won’t be needing it
    • Drag off the Event BeginPlay node and search for “Create Widget”
      • Set Class to HUD
      • Right Click on Return Value and select Promote To Variable
        • Name it: HUDReference
          • Drag off the blue pin and search for “Add to Viewport”

13 of 16

Prep Work

In the MyPlayerController Blueprint...

  • In the EventGraph...
    • Right click inside the graph and search for Get Player Pawn
      • Drag off the Return Value and search for “Cast To VehicleBlueprint”
    • Connect the Add to Viewport node to the Cast To VehicleBlueprint node.
    • In the Cast To VehicleBlueprint node, right click on As Vehicle Blueprint and promote it to a variable. Name it Vehicle Reference.

14 of 16

Prep Work

In the MyPlayerController Blueprint...

  • In the EventGraph...
    • The string of nodes should look like this when complete

15 of 16

Prep Work

In the MyPlayerController Blueprint...

  • In the EventGraph...
    • Create 8 Custom Events
      • StartGameSetup
      • Restart
      • UpdateLap
      • RespawnVehicle
      • StartRaceTime
      • StopRaceTime
      • StartLapTime
      • StopLapTime
    • Compile and Save

16 of 16

Prep Work

In the Game Editor Viewport…

  • Select and move the vehicle on to the track
  • We now want to create a copy of the current map that we are working on so do a “save as” and rename our new map as LooptyLoopMap
      • From here on out we will build everything in this new map