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

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.

主站蜘蛛池模板: 宾川县| 长宁区| 廉江市| 德庆县| 奈曼旗| 商洛市| 万载县| 麟游县| 庄浪县| 施甸县| 尤溪县| 香格里拉县| 招远市| 荣成市| 察雅县| 宜君县| 乌兰察布市| 新建县| 竹山县| 松原市| 柞水县| 鄢陵县| 成武县| 新沂市| 日照市| 龙江县| 呼和浩特市| 讷河市| 威远县| 海南省| 桑日县| 松溪县| 谢通门县| 茌平县| 汝州市| 辉县市| 双峰县| 古田县| 仙桃市| 衡水市| 汉源县|