How to integrate the LIV Camera Kit (LCK) tablet into your Unreal Engine VR game, including subsystem access, tablet lifecycle, grab setup, widget components, async callback patterns, and safe delegate binding.
void AMyGameMode::DestroyLCKTablet(){ if (SpawnedTablet) { // Stop any active recording first if (ULCKService* Service = GetLCKService(GetWorld())) { if (Service->IsRecording()) { Service->StopRecording(); } } SpawnedTablet->Destroy(); SpawnedTablet = nullptr; }}
The UI doesn’t handle grabbing mechanics. Grabbing is game-specific and it’s up to developers to integrate.Here’s an example using the GrabComponent from Unreal’s VR Template. Make sure you call GrabStarted and GrabEnded methods on LCKTablet. You can set them up in C++ or Blueprint.
void ALCKTablet::BeginPlay(){ Super::BeginPlay(); // 1. Create and initialize data model DataModel = NewObject<ULCKTabletDataModel>(this); DataModel->Initialize(); // 2. Load saved settings LoadSettings(); // 3. Initialize camera system (CaptureComponent is inherited from ALCKTabletUI) InitializeCameraCapture(); // 5. Bind to service events BindToServiceEvents(); // 6. Send spawn telemetry SendSpawnTelemetry();}
Cause: World not valid or subsystem not registered.Solution:
// Ensure world is validif (!GetWorld()){ UE_LOG(LogLCK, Error, TEXT("No world available")); return;}// Check if game is still runningif (GetWorld()->bIsTearingDown){ return;}
Callbacks not firing
Cause: Object destroyed before callback or delegate unbound.Solution: Use weak pointers and verify binding:
Cause: Widget component not properly configured.Solution:
TabletWidget->SetWidgetSpace(EWidgetSpace::World);TabletWidget->SetDrawSize(FVector2D(800, 600));TabletWidget->SetTwoSided(true); // Visible from both sidesTabletWidget->RequestRedraw();