diff --git a/Content/Pawn/BP_RWTHVRPawn_Default.uasset b/Content/Pawn/BP_RWTHVRPawn_Default.uasset index 97b68c3ad42d2a9760b785f4e0cf9cf4391d6e34..7bcca686b189d765bd7476bf9ffb1ee4bd0ade71 100644 Binary files a/Content/Pawn/BP_RWTHVRPawn_Default.uasset and b/Content/Pawn/BP_RWTHVRPawn_Default.uasset differ diff --git a/Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp b/Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp index f31909feef9e99f2c4f2d7ce052f4e9dee59a3af..bb90198d63fbd9b235fb6b6143a7fea1161a6535 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp @@ -78,9 +78,13 @@ void ARWTHVRPawn::NotifyControllerChanged() // If we are also the authority (standalone or listen server), directly attach it to us. // If we are not (client), ask the server to do it. if (HasAuthority()) + { AttachDCRAtoPawn(); + } else + { ServerAttachDCRAtoPawnRpc(); + } } } } @@ -135,8 +139,10 @@ void ARWTHVRPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponen } // bind the current mapping contexts - AddInputMappingContext(PlayerController, CurrentGeneralInputMappingContext); - AddInputMappingContext(PlayerController, CurrentMovementInputMappingContext); + for (const auto& Mapping : InputMappingContexts) + { + AddInputMappingContext(PlayerController, Mapping); + } } void ARWTHVRPawn::AddInputMappingContext(const APlayerController* PC, const UInputMappingContext* Context) const @@ -183,7 +189,9 @@ void ARWTHVRPawn::EvaluateLivelink() const HeadSubjectRepresentation.Role, SubjectData); if (!bHasValidData) + { return; + } // Assume we are using a Transform Role to track the components! This is a slightly dangerous assumption, and // could be further improved. diff --git a/Source/RWTHVRToolkit/Public/Pawn/RWTHVRPawn.h b/Source/RWTHVRToolkit/Public/Pawn/RWTHVRPawn.h index 9f676d1131ac0986c7ce71e5ac7b96c6b74a77c4..ca774d3766c41da61f095c06e27ceaa115324094 100644 --- a/Source/RWTHVRToolkit/Public/Pawn/RWTHVRPawn.h +++ b/Source/RWTHVRToolkit/Public/Pawn/RWTHVRPawn.h @@ -32,10 +32,7 @@ public: virtual void NotifyControllerChanged() override; UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Pawn|Input") - UInputMappingContext* CurrentGeneralInputMappingContext; - - UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Pawn|Input") - UInputMappingContext* CurrentMovementInputMappingContext; + TArray<UInputMappingContext*> InputMappingContexts; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Pawn|MotionControllers") UMotionControllerComponent* RightHand;