move socket name to a temp var for easier debugging

This commit is contained in:
Mamadou Babaei
2023-05-19 18:14:00 +02:00
parent 2917c555ce
commit 51d4d72998
@@ -1227,13 +1227,15 @@ void ASGPawn::GrabLeft(AActor* Actor)
return; return;
} }
FAttachmentTransformRules AttachmentTransformRules{ FAttachmentTransformRules AttachmentRules{
FAttachmentTransformRules(GrabComponent->GetAttachmentLocationRule(), FAttachmentTransformRules(GrabComponent->GetAttachmentLocationRule(),
GrabComponent->GetAttachmentRotationRule(), GrabComponent->GetAttachmentRotationRule(),
GrabComponent->GetAttachmentScaleRule(), GrabComponent->GetAttachmentScaleRule(),
GrabComponent->GetAttachmentWeldSimulatedBodies()) GrabComponent->GetAttachmentWeldSimulatedBodies())
}; };
Actor->AttachToComponent(HandLeft, MoveTemp(AttachmentTransformRules), GrabComponent->GetAttachmentSocketName()); FName SocketName{GrabComponent->GetAttachmentSocketName()};
Actor->AttachToComponent(HandLeft, MoveTemp(AttachmentRules), MoveTemp(SocketName));
ActorLeftHandGrabbing = Actor; ActorLeftHandGrabbing = Actor;
} }
@@ -1251,13 +1253,15 @@ void ASGPawn::GrabRight(AActor* Actor)
return; return;
} }
FAttachmentTransformRules AttachmentTransformRules{ FAttachmentTransformRules AttachmentRules{
FAttachmentTransformRules(GrabComponent->GetAttachmentLocationRule(), FAttachmentTransformRules(GrabComponent->GetAttachmentLocationRule(),
GrabComponent->GetAttachmentRotationRule(), GrabComponent->GetAttachmentRotationRule(),
GrabComponent->GetAttachmentScaleRule(), GrabComponent->GetAttachmentScaleRule(),
GrabComponent->GetAttachmentWeldSimulatedBodies()) GrabComponent->GetAttachmentWeldSimulatedBodies())
}; };
Actor->AttachToComponent(HandRight, MoveTemp(AttachmentTransformRules), GrabComponent->GetAttachmentSocketName()); FName SocketName{GrabComponent->GetAttachmentSocketName()};
Actor->AttachToComponent(HandRight, MoveTemp(AttachmentRules), MoveTemp(SocketName));
ActorRightHandGrabbing = Actor; ActorRightHandGrabbing = Actor;
} }