How to spawn an item and attach it to player?

I am trying to make an Overcooked clone as practice and I need some guidance on this problem I’ve been trying to fix for the last few days. This code is in the dispenser box.

What I’m trying to achieve is that when I hit the box, it summons the item, and then puts it in my hands. if I hit it again while holding the item, the item is placed back on top of the box, however, it shouldn’t let me spawn another item.

void AWBDispenserBox::Interact()
{

if(bCanUse)
{
	UE_LOG(LogTemp, Warning, TEXT("Dispensing ingredient!~~~"));
	const FVector Location = IngredientSpawnPoint->GetComponentLocation();
	const FRotator Rotation = GetActorRotation();

	AActor* Ingredient = GetWorld()->SpawnActor<AActor>(IngredientsClass, Location, Rotation);
	Ingredient->DetachFromActor(FDetachmentTransformRules::KeepWorldTransform);
	Ingredient->AttachToActor(WBCharacter, FAttachmentTransformRules::KeepWorldTransform, "GrabSpot");

	bCanUse = false;
}
else
{
	UE_LOG(LogTemp, Warning, TEXT("Ingredient already on table!"));
}

}

If you can confirm that “Dispensing ingredient!” appears multiple times, then you must be setting bCanUse to true somewhere else. Try searching for it with Ctrl+F.

The issue isn’t the log message, that I just set for debugging purposes. After the first interaction with the box, so far all I have it do is spawn the item on top of it, after that bCanUse is set to false, because the box is in use. What I am trying to learn to do is instead of spawning on top of the box, I want it to spawn in the player’s hand as a grabbed item they can put down and pick up again. I am just not sure how to tackle the problem.