diff --git a/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp b/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp index 5cb60523..a1dc7b56 100644 --- a/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp +++ b/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp @@ -1227,13 +1227,13 @@ void ASGPawn::GrabLeft(AActor* Actor) return; } - Actor->AttachToComponent( - HandLeft, + FAttachmentTransformRules AttachmentTransformRules{ FAttachmentTransformRules(GrabComponent->GetAttachmentLocationRule(), GrabComponent->GetAttachmentRotationRule(), GrabComponent->GetAttachmentScaleRule(), - GrabComponent->GetAttachmentWeldSimulatedBodies()), - GrabComponent->GetAttachmentSocketName()); + GrabComponent->GetAttachmentWeldSimulatedBodies()) + }; + Actor->AttachToComponent(HandLeft, MoveTemp(AttachmentTransformRules), GrabComponent->GetAttachmentSocketName()); ActorLeftHandGrabbing = Actor; } @@ -1251,13 +1251,13 @@ void ASGPawn::GrabRight(AActor* Actor) return; } - Actor->AttachToComponent( - HandRight, + FAttachmentTransformRules AttachmentTransformRules{ FAttachmentTransformRules(GrabComponent->GetAttachmentLocationRule(), GrabComponent->GetAttachmentRotationRule(), GrabComponent->GetAttachmentScaleRule(), - GrabComponent->GetAttachmentWeldSimulatedBodies()), - GrabComponent->GetAttachmentSocketName()); + GrabComponent->GetAttachmentWeldSimulatedBodies()) + }; + Actor->AttachToComponent(HandRight, MoveTemp(AttachmentTransformRules), GrabComponent->GetAttachmentSocketName()); ActorRightHandGrabbing = Actor; }