From 45f6ecacd2699d12911202e5a442b0ffa3cebd7d Mon Sep 17 00:00:00 2001 From: Mamadou Babaei Date: Fri, 12 May 2023 15:47:21 +0200 Subject: [PATCH] move socket name to a temp var for easier debugging --- .../Private/SenseGlove/GameFramework/SGPawn.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp b/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp index a1dc7b56..b4dc3bf6 100644 --- a/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp +++ b/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp @@ -1227,13 +1227,15 @@ void ASGPawn::GrabLeft(AActor* Actor) return; } - FAttachmentTransformRules AttachmentTransformRules{ + FAttachmentTransformRules AttachmentRules{ FAttachmentTransformRules(GrabComponent->GetAttachmentLocationRule(), GrabComponent->GetAttachmentRotationRule(), GrabComponent->GetAttachmentScaleRule(), GrabComponent->GetAttachmentWeldSimulatedBodies()) }; - Actor->AttachToComponent(HandLeft, MoveTemp(AttachmentTransformRules), GrabComponent->GetAttachmentSocketName()); + FName SocketName{GrabComponent->GetAttachmentSocketName()}; + + Actor->AttachToComponent(HandLeft, MoveTemp(AttachmentRules), MoveTemp(SocketName)); ActorLeftHandGrabbing = Actor; } @@ -1251,13 +1253,15 @@ void ASGPawn::GrabRight(AActor* Actor) return; } - FAttachmentTransformRules AttachmentTransformRules{ + FAttachmentTransformRules AttachmentRules{ FAttachmentTransformRules(GrabComponent->GetAttachmentLocationRule(), GrabComponent->GetAttachmentRotationRule(), GrabComponent->GetAttachmentScaleRule(), GrabComponent->GetAttachmentWeldSimulatedBodies()) }; - Actor->AttachToComponent(HandRight, MoveTemp(AttachmentTransformRules), GrabComponent->GetAttachmentSocketName()); + FName SocketName{GrabComponent->GetAttachmentSocketName()}; + + Actor->AttachToComponent(HandRight, MoveTemp(AttachmentRules), MoveTemp(SocketName)); ActorRightHandGrabbing = Actor; }