move socket name to a temp var for easier debugging

This commit is contained in:
Mamadou Babaei
2023-05-19 18:15:38 +02:00
parent ac81d34f7f
commit fa02bdbdf9
@@ -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;
} }