Victory Box
The next step in our project is going to be creating the VictoryBox
actor. This actor will be responsible for ending the game when the player character enters it, given that the player has beaten the level. In order to do this, we'll be using the Overlap
event. The following exercise will help us understand Victory Box.
Exercise 6.05: Creating the VictoryBox class
In this exercise, we will be creating the VictoryBox
class, which, when entered by the player character, will end the game.
The following steps will help you complete this exercise:
- Create a new C++ class that inherits from the actor and call it
VictoryBox
. - Open that class's files in Visual Studio.
- Create a new
SceneComponent
property, which will be used as aRootComponent
, just like we did with ourWall
C++ class:Header
file:private: UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = VictoryBox, meta = (AllowPrivateAccess = "true")) class USceneComponent* RootScene...