Character


1 Overview

This document will explain how to setup a pawn based our framework.


2 Basic Setup

See the example as following blueprint.

  • /Game/USGT/Game/CoreModules/Character/BP_GamePawn

Create child blueprint class of BP_Character_USG as follow:


pawnsetup

Modify the properties under the category “USG Config” according to your requirement.


3 State Mutex Setting

In the game, a character has different states , such as walk, sprint, vault, jump, attack and so on. While developing the logic of a character, developers need to control these states to promise the character display correctly. In a word, we need to control these states with a state machine.

Create the state mutex setting asset as following example.

  • /Game/USGT/Framework/Character/States/DA_StateMutexSetting

Config the state mutex setting as following.

mutexstateconfig

  • MutexStates: Cannot enter target state if pawn is in already these config states. For example (from above picture), character can not enter jump state if pawn is crouch or prone state.

  • LeaveStatesIfFail: Leave these states if enter target state failed. For example, if charater enters jump state failed, the character will leave crouch or prone state so as to make the character standing up.

  • LeaveStatesIfSuccess: Leave these states if enter target state successful.

Notice that the developer can add a new state type to the following blueprint enum:

  • /Game/USGT/Framework/Character/State/EN_CharacterState.

newstate


4 Camera Management

The camera management is very important for shooting game. For example, control the camera to first person view or third person view based on different camera.

Camera position adjustment is the critical step to reach a perfect view for shooting game.

  • SpringArm: Adjust spring arm Location, TargetArmLength, Socket Offset and TargetOffset to keep the camera at a perfect state for shooting.

  • CameraManager:See section 3 of PlayerController chapter.


springarm


4 Character Effect Proxy

Character effect proxy component:

  • Game/USGT/Framework/Character/Effet/BP_CharacterEffectProxy_USG

This component is used to control the character client effects, such as emote playing, hit or dead effects.