Skip to content

Pattern — Portable Device & Battery

Portable devices use AOperatingSystemPortableDeviceActor with simulated battery, charging, and C++ events exposed to Blueprint via Device Messenger.

stateDiagram-v2
  [*] --> CheckBattery: Actor BeginPlay
  CheckBattery --> Boot: Battery > 0 or charging
  CheckBattery --> NoBoot: Battery = 0
  Boot --> Running: Normal OS boot
  Running --> LowBattery: Level < warning threshold
  LowBattery --> Running: Player plugs in charger
  Running --> SaveGame: Battery Save State Flags

The plugin also ships a phone OS skin:

  • OS: Phone/Blueprints/BP_OS_Phone
  • Mobile audio player: Phone/Blueprints/Programs/BP_Prog_AudioPlayer_Mobile

Study these when building a phone or tablet form factor.