diff --git a/Source/RWTHVRToolkit/Private/Pawn/Navigation/TeleportationComponent.cpp b/Source/RWTHVRToolkit/Private/Pawn/Navigation/TeleportationComponent.cpp index fd805c9212dfeb6149a97b318e19bf172d39cd27..3a1a7e054daf3e2f3e544313ee8505316ada9ff5 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/Navigation/TeleportationComponent.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/Navigation/TeleportationComponent.cpp @@ -27,14 +27,16 @@ void UTeleportationComponent::SetupPlayerInput(UInputComponent* PlayerInputCompo GetWorld(), TeleportTraceSystem, VRPawn->GetActorLocation(), FRotator(0), FVector(1), true, true, ENCPoolMethod::AutoRelease, true); - FActorSpawnParameters SpawnParameters = FActorSpawnParameters(); - SpawnParameters.Name = "TeleportVisualizer"; - - if (BPTeleportVisualizer) + if (!BPTeleportVisualizer) { - TeleportVisualizer = GetWorld()->SpawnActor<AActor>(BPTeleportVisualizer, VRPawn->GetActorLocation(), - VRPawn->GetActorRotation(), SpawnParameters); + UE_LOG(Toolkit, Error, + TEXT("SetupPlayerInput: BPTeleportVisualizer must be set to an Actor class that can be spawned!")); + return; } + + TeleportVisualizer = + GetWorld()->SpawnActor<AActor>(BPTeleportVisualizer, VRPawn->GetActorLocation(), VRPawn->GetActorRotation()); + TeleportTraceComponent->SetVisibility(false); TeleportVisualizer->SetActorHiddenInGame(true);