Skip to content

Pawns

ADRW_VesselPawn: abstract; subclass to a Blueprint to instantiate.

Purpose: Pawn wrapper for direct player possession of vessels. Combines all vessel components with Enhanced Input and camera.

Use VesselPossessionComponent on your player pawn, call RequestPossessVessel(VesselPawn). Or use APlayerController::Possess() directly on the server.

VesselPawn implements IDRW_VesselController, the interface DRW uses to read input from whatever is driving a vessel. To write your own controller (for AI ships, scripted boats, etc.) you can either:

  • Drive the existing pawn by feeding SetInput() on the vessel (simplest, works from Blueprint).
  • Implement IDRW_VesselController yourself for a non-pawn driver. The interface’s input methods are pure C++ virtuals, so a custom controller class must be written in C++: Blueprint-only classes cannot satisfy the interface in this version.
KeyAction
W / SThrottle
A / DSteering
MouseCamera look
ScrollCamera zoom

Customize by setting InputSource on VesselInputComponent or providing a VesselInputConfig.

PropertyTypeDefaultDescription
VesselDataVesselDataAsset:Master config (required before BeginPlay).
HullMeshAssetStaticMesh:Hull mesh.
bEnableMultiplayerbooltrueNetwork support.
NetUpdateRatefloat30.0Hz. Range: 1–60.
OriginalPawnPawn:Pawn to return to on exit (auto-set).
FunctionReturnsDescription
Server_RequestExitVessel()voidExit vessel, return to OriginalPawn (Server RPC).
GetSpeed() / GetSpeedKnots()floatSpeed.
GetHeading()float0–360 heading.
IsInWater() / IsPlaning()boolState.
GetHullMesh / PhysicsBody / Buoyancy / Movement / VesselInput / VesselCamera / Replication()ComponentComponent access.

Multiplayer: Server-authoritative. Input replicated. OriginalPawn replicated with RepNotify.


ADRW_DronePawn

Purpose: Flying camera pawn for testing vessel possession, seat occupation, and ocean wave switching. Use this as your default pawn during development.

Set as the default pawn in your GameMode (use BP_DRWGameMode).

KeyAction
WASDFly
MouseLook
E / QUp / Down
ShiftSprint
FInteract (possess vessel or enter seat)
1 / 2 / 3Switch ocean wave presets

Flying, ControllingVessel

PropertyTypeDefaultDescription
FlySpeedfloat1000.0Normal speed (cm/s).
SprintSpeedfloat3000.0Sprint speed (cm/s).
LookSensitivityfloat0.5Look sensitivity.
SeatInteractionRangefloat500.0Seat discovery range (cm).
SmallWavesDataWaveDataAsset:Key 1 wave preset.
MediumWavesDataWaveDataAsset:Key 2 wave preset.
HighWavesDataWaveDataAsset:Key 3 wave preset.
WaveBlendDurationfloat10.0Blend time (seconds).
FunctionReturnsDescription
TryEnterNearestSeat()boolFind and enter nearest seat.
ExitCurrentSeat()boolLeave current seat.
TryPossessNearestVessel()boolPossess nearest VesselPawn.
ToggleVesselControl()voidF key: tries possession first, then seat.
GetDroneState()DroneStateFlying or ControllingVessel.
GetControlledVessel()VesselCurrent vessel.