Download

How to dynamically switch between 1stPersionViewMode and 3rdPersonViewMode?

how to dynamically switch between 1stPersionViewMode and 3rdPersonViewMode?
set DefaultPawnClass after GameModeBase::InitGame seems not work, but before GameModeBase::InitGame set DefaultPawnClass does work.

You should have only one character, but with both view modes set up (only one visible at a time). Most of your game logic can stay the same. When you switch between the view modes, you set the visibility of the actors (or destroy them all together) you don’t want/want to see e.g. the 1st person weapon + hands.

We do it as follows:

  • have a base character
  • have a 1st person character, inherit from base character
  • have a 3rd person character, inherit from base character
  • use Possess() to switch between them

AController::Possess | Unreal Engine Documentation

Works great and added benefit of 1st person and 3rd person functionality being encapsulated separately. BaseCharacter implements all the common stuff to all characters.

Handles attaching this controller to the specified pawn. Only runs on the network authority (where HasAuthority() returns true).
so if mine is a network multiplayer game, this method is not suitable?

watching ShooterGame demo, seems it’s better to combine them into class AShooterCharacter : public ACharacter.
looking for pure C++ VR motionControllerPawn.