← Back to project technical overview

This article records the complete development process of a feature study project for validating the character transformation, flight, and boost dash. The project is based on the UE 5.8.1 engine, with C++ implementing the core logic and Blueprints used only to configure asset references.

— Development record preface

1. Project goals

Implement a complete character form transformation and flight-and-dash system, including the following features:

  1. Press T to enter/exit the transformed form
  2. After transforming, the character flies forward automatically, and W/A/S/D steers up/down/left/right
  3. After transforming, the field of view (FOV) widens from 80 to 120
  4. After transforming, press the right mouse button to enter boost mode: speed rises sharply, and a one-shot boost VFX plays
  5. Press the right mouse button again to exit boost mode
  6. A flash transition VFX plays at the moment of transformation, and the form switches after 0.4 s
  7. When exiting the transformation, the character stops moving immediately and does not keep surging forward
  8. The form switch is accompanied by a dissolve transition effect (MPC material parameter set reserved)

2. Project structure and tech stack

Key assets

AssetPurpose
BP_ThirdPersonCharacterOfficial third-person character Blueprint; parent class changed to TransformBase
BP_Projectile_IceTransformation effect Blueprint Actor containing multiple Niagara components
NS_StarSkill002Persistent purple sphere particle after transformation
NS_DashTransformation burst trail VFX (changed to the Ribbon renderer)
NS_FlyLine_001Custom trail VFX
NS_JiaSuBoost VFX
NS_SpriteSpawnTransformation flash transition VFX
MPC_DissolveDissolve effect material parameter set

3. Production method and core implementation

3.1 Input binding

The project uses the legacy UInputComponent rather than Enhanced Input, so keys are bound directly with BindKey:

Binding location: TransformBase::SetupPlayerInputComponent

3.2 Form-switching flow

After pressing T, the flow first enters the 0.4 s flash transition stage.

Entering the transformation

  1. Call StartDissolveOut() to begin the dissolve fade-out
  2. Spawn the NS_SpriteSpawn flash VFX at the character position
  3. Execute ExecuteEnterTransform() after 0.4 s
  4. Hide the character mesh, spawn the transformation effect Actor, switch to MOVE_Flying mode
  5. Set FOV to 120

Exiting the transformation

  1. Immediately set bIsInTransformedForm = false and stop the flight logic
  2. Immediately zero the velocity, stop movement, and switch back to MOVE_Walking
  3. Destroy the transformation effect Actor and restore the character mesh
  4. Call StartDissolveIn() to begin the dissolve fade-in
  5. Execute ExecuteExitTransform() after 0.4 s
  6. Restore FOV to 80

3.3 Flight control

Flight is implemented in Tick() after transformation:

StateAuto flight speedSteering speed
Normal1200 cm/s800 cm/s
Boost5000 cm/s4000 cm/s

The early implementation used AddMovementInput, but because it is limited by CharacterMovementComponent::MaxAcceleration, the sense of acceleration was not obvious. The final version computes DesiredVelocity directly and smooths MoveComp->Velocity via FMath::VInterpTo, significantly improving acceleration response.

3.4 Boost system

The right mouse button toggles the bIsBoosting state:

3.5 Niagara VFX and velocity handoff

The effect Actor spawned after transformation contains multiple Niagara components. In Tick(), the character's world velocity GetVelocity() is read and handed to Niagara via SetVariableVec3("User.FlyVelocity", FlyVel), driving trail, inertia swing, and other particle effects.

4. Issues and fixes during development

IssueRoot causeFix
Pressing T does nothingPlayerInputComponent is NULL in SetupPlayerInputComponentBind the T key directly inside that function via BindKey
No Niagara VFX visible after transformationWrong path; the Blueprint CDO serializes FormNiagaraSystem as NoneCorrect the path to /Game/Test_02/VFX/BlackVFX/NS_StarSkill002; repair the CDO reference with a Python script
Particles do not disappear after exiting transformationOn exit, only the mesh is hidden; the effect Actor is not destroyedCall SpawnedTransformVFX->Destroy() and clear the pointer
Post-transformation FOV change has no effectAPlayerController::SetFOV() is overridden by the camera componentUse PlayerCameraManager->SetFOV() instead
Character keeps surging forward after exiting transformationCharacterMovementComponent retains inertial velocityImmediately set non-transformed, zero Velocity, call StopMovementImmediately()
Boost VFX works but the speed does not changeThe Blueprint CDO serializes the speed as 0; AddMovementInput is limited by MaxAccelerationForce-reset the speed in BeginPlay(); set Velocity directly
Character material lost and turned grayAdding dissolve nodes to M_Mannequin left OneMinus unconnected correctlyDelete the wrong node and reconnect with the correct pin name "None"
Ribbon trail not visibleNiagara uses local space, so its own velocity is 0Switch to world-space simulation, add the Inherit Velocity and Drag modules
Blueprint compile-error popupDeprecated template assets BP_Dummy_Character, W_Projectiles_HUDUnrelated to the transformation system; click "Run in editor" and continue testing

5. Modified code files

5.1 Source/Test/Public/TransformCharacter.h

5.2 Source/Test/Private/TransformCharacter.cpp

6. Key parameter summary

ParameterValueDescription
Normal auto flight speed1200 cm/sAuto-forward speed after transformation when the right mouse is not held
Normal steering speed800 cm/sWASD steering speed after transformation
Boost auto flight speed5000 cm/sAuto-forward speed after right-mouse boost
Boost steering speed4000 cm/sWASD steering speed after right-mouse boost
Transformation FOV120Field of view after transformation
Default FOV80Field of view restored after exiting transformation
Flash delay0.4 sTime from pressing T to the formal transformation
Transformation cooldown0.5 sCooldown to prevent rapid repeated triggering
Velocity interpolation rate8.0Transition rate of VInterpTo

7. Takeaways

  1. Blueprint CDO overwrites C++ default values: for critical configuration properties (Niagara references, speed values), either force-set them in BeginPlay() or hard-code the path in the constructor via ConstructorHelpers::FObjectFinder.
  2. Set flight velocity directly first: AddMovementInput fits the character movement framework better, but is limited by MaxAcceleration; direct Velocity setting feels sharper for fast acceleration.
  3. FOV must go through PlayerCameraManager: setting the PlayerController FOV directly is overridden by the camera component.
  4. Stopping movement must happen immediately on exiting the transformation: otherwise the character keeps surging forward from inertia, and the feel is damaged.
  5. Niagara trails need world space + Inherit Velocity: in local space, particles have no own velocity and no trail forms.
  6. A complete recompile is required after editing .h: new UPROPERTY/UFUNCTION members are reflection-structure changes that Live Coding cannot hot-swap.

Migration note. The current implementation lives in the standalone test project Test_02; to migrate TransformBase into the CultivatingImmortality_RPG main project, also migrate BP_Projectile_Ice and its Niagara asset references, and replace TEST_API with the main project module's API macro.