Image added to horizontal box does not have the right size

I’m trying to create a card game (which seems more difficult than I thought since there is little to no documentation). Anyway, I’m trying to add cards to a table (which is a widget) and add the cards to a horizontal box (player’s hand). However, whenever I add the image it has the right height but has a completely different width and I can’t seem to change it.

Code to add card:

void AHand::AddCard(ACard* Card)

	UImage* Image = NewObject<UImage>();

	const FString CardSuit = StaticEnum<ECardSuitEnum>()->GetValueAsString(Card->CardSuit);
	const FString CardRank = StaticEnum<ECardSuitEnum>()->GetValueAsString(Card->CardRank);

	FString Path = FString("/Game/Images/CardFront/" + CardSuit + "/" + CardRank);

	UTexture2D* Texture = Cast<UTexture2D>(StaticLoadObject(UTexture2D::StaticClass(), NULL, *Path));



Your problem will be the layout & spacing options that the horizontal box is applying to your UImages.

I think the best way to do this is to create a UCardWidget that inherits from UUserWidget. That way, you can create a blueprint subclass and do all of the layout work in there instead of trying to figure it out in code.