官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 灵武市| 宿州市| 巴彦县| 宁河县| 扬州市| 安阳市| 镇康县| 满城县| 大厂| 武安市| 环江| 屏东县| 北海市| 凤凰县| 崇仁县| 瑞安市| 多伦县| 曲水县| 通海县| 清涧县| 衡南县| 金湖县| 同心县| 获嘉县| 西乌| 钟山县| 苏州市| 丰宁| 界首市| 高要市| 观塘区| 安仁县| 波密县| 临西县| 宁化县| 宜章县| 延川县| 望奎县| 贵溪市| 五华县| 盐津县|