Warm Up
Worth 3 Points
What are you learning?
Unreal Engine - Last individual project
Why is it important?
Show what you can do
How do you show that you understand? What is the assignment?
You have created a parkour course and a maze.
This week, you are to combine those skills to create a puzzle game with pressure plates.
Your game must have a minimum of 10 parkour elements so a player must jump and land somewhere to continue the game
You game must have at least 10 dead ends
Your game must include the use of five pressure plates in order to continue the game
You game must take a minimum of three minutes to play from start to finish.
Once you have completed your game, you are to record the game play using screenpal (formerly screencastomatic) or a similar screen recording software to record you playing your game from start to finish. You are to explain what you chose to use and why while you are playing through your game.
If you finish early, you are to continue to add assets to your game.
Points
10 Parkour Elements - 2 Point
10 Dead Ends - 2 Point
5 pressure Plates - 2 Point
Three Minutes of game play - 2 Point
Video with explanation - 2 Point
Total 10 Points
DUE FRIDAY!
**Adding Physics to Objects**
Window
Place Actor
Choose one and add it to your game
Make sure simulate physics is selected in details panel
You can check the Mass Box in your details to change the weight
Exporting Blender Files
File
Export
FBX
Name It
Operator Presets - Default
Select Objects
Mesh
Geometry
-Smoothing Face
Unclick bake animation
Open your content drawer and open the blueprints folder then open the FirstPersonTemplate Folder
Right Click
Find Blueprints
Select Blueprint Interface
Name it BPI_Interaction and double click to open it up
In the functions in the right side, create a function called Interact
Compile and save
Go back to your First person map
Open your content drawer and the doors folder in your blueprints
Right Click on the Door Parent Blueprint and select Create Child Blueprint Class
Name it PBC_Door_Interface
Double Click to open it up
We are going to add the interface to the actor by clicking Class settings at the top
Under Interfaces in the Details Panel
Click ADD
search for BPI_Interaction
Once you have added it, you should see it in the Interfaces in the MyBlueprints Tab on the left
Right Click on the Interact and select Implement Event
This will open up your Event Graph
From your Event Interact Node, pull out a Flip Flop from the Exec
From A, pull out and add Open Door
From B, pull out and add Close Door
You can reuse this Event Interact to do many things like open doors or talk with NPCs
Compile and Save
Go back to the First Person Map and open up the First Person Character Event Graph
We are now going to add our new Interact Input Action
Add an action event Interact
When you press interact, we want the game to check if there is anything near you that can be interacted with
From the Pressed Exec, pull out and connect a Sphere Trace By Channel
This is going to draw a line around a chosen radius and look for actors to interact with
We want our Start Point to be our Camera since it is attached to the character
Under Components, add your first person camera to the event graph
From the First Person Camera Node, pull out and add a GetWorldLocation node
Connect your Return Value to the Start in Sphere Trace by Channel
What this is doing is making wherever the camera is located the start position
From the First Person Camera Node, pull out and add Get Forward Vector
What this does is gets the forward facing direction of the first person camera
From the Return Value, we want to add a Multiply and multiply it by a float so we can get the range we want to search for actors to interact with.
Pull out a link from the Return Value and add Multiply
What we are going to do now is add the value to the current location value
From the Return Value of the GET World Location, pull out and add a +
Connect the output of the + node to the End of the Sphere Trace By Channel
Connect the Output of the Multiply Node to the bottom Input of the Addition Node
We are going to convert the bottom input of the Multiple info a float by right clicking the pin
Selecting Convert Pin
Choose Float (single-precision)
Change the float value to 500
Then in your Sphere Trace, change the radius to 2
Enable Draw Debug Type For Duration
Compile and Save
Test the game and press E
You will see the lines drawn that checks for actors to interact with
Return to event graph
Now we will make it interact with an actor
Pull a link from the Out Hit in the Sphere Trace and select Break Hit Result
You can see all the hit results that come with the trace
From Break Hit Result, pull out a branch from Blocking Hit
Connect the exec output of the Sphere Trace to the Exec input of the branch
We can check to see if the actor that shows up has the interaction interface by pulling out a connection from the Hit Actor Node and adding Does implement interface
In the Does implement interface, select BPI_Interaction
Add another Branch
Connect the True Output Exec from the first branch to the input exec of the second branch
Connect the Return Value of the Does Implement Interface with the condition of the new branch
Drag out another link from the Hit Actor in the Break Hit Result
Add an Interact (message)
Connect True Exec Output of the second branch to the Exec input of the Interact
This interaction will work with any actor that has that interface