需求:
通过GameMode_OculusBase设置

  • 在哪里生成Pawn
  • 生成什么Pawn(PC/VR)
  • 生成多少Pawn

蓝图实现

首先创建一个表明出生位置的Actor
Dev文件夹

  • 新建Actor,BP_PlayerStart
    • 组件添加:arrow(向量表明位置和朝向)
    • 添加变量(点击眼睛使其instance editable?Settings分类):
      • PlayAsPC(Boolean)
      • StartNumber(int)
    • 将其拖入Level

instance editable 允许每个实例拥有不同的设置

从大纲视图删除MotionControllerPawn_OculusBase
GameInstance_OculusBase

  • 新建变量Struc_VRPlayerSettings
    • Categories- PlayerSettings

GameMode_OculusBase

  • Event
    • Get Game Instance - case to GameInstance_OculusBase

操作很复杂,难以记录,需要多实践,去理解。