- Mastering Unreal Engine 4.X
- Muhammad A.Moniem
- 129字
- 2021-07-14 11:20:41
Adding the blueprint to the GameMode
Once everything is in place, all that we need now is to make sure that the GameMode
class for the game (or for this level) is going to load our Gladiator blueprint by default once the game starts.
Open the Visual Studio project again, go to the BellzGameMode
source file, and add this piece of code inside its constructor, in order to set the DefaultPawnClass
by defining which blueprint is to be used by specifying its name and path within the project.
static ConstructorHelpers::FClassFinder<APawn> PlayerPawnBPClass(TEXT("/Game/Blueprints/GladiatorCharacter")); if (PlayerPawnBPClass.Class != NULL) { DefaultPawnClass = PlayerPawnBPClass.Class; }
And now, if you start an empty level with the basic elements, or even one of the free asset levels, you'll have the Gladiator fully interactive inside the level.

推薦閱讀
- DevOps for Networking
- NativeScript for Angular Mobile Development
- 精通API架構:設計、運維與演進
- Swift Playgrounds少兒趣編程
- AIRIOT物聯(lián)網(wǎng)平臺開發(fā)框架應用與實戰(zhàn)
- D3.js By Example
- Learning Apache Cassandra
- Learning Material Design
- 鴻蒙OS應用編程實戰(zhàn)
- 零基礎學Python編程(少兒趣味版)
- C++程序設計教程
- 玩轉(zhuǎn).NET Micro Framework移植:基于STM32F10x處理器
- Java并發(fā)實現(xiàn)原理:JDK源碼剖析
- 從零開始學Unity游戲開發(fā):場景+角色+腳本+交互+體驗+效果+發(fā)布
- Java面試一戰(zhàn)到底(基礎卷)