How do I use 'SetVisibility' with SCompoundWidget?

So I’ve been following >this< tutorial to get up to speed with slate, however I quickly stumbled upon a problem that I can’t seem to figure out.

The following line of code in my HUD class

if (WidgetHealth.IsValid())
		WidgetHealth.SetVisibility(EVisibility::Visible);

produces this error:

'SetVisibility' : is not a member of 'TSharedPtr<SWidgetHealth,0>'

Everything I’ve done so far is a complete copy and paste of the previously linked tutorial (I’ll add my classes in the description anyway, since there may be some typos that I can’t see at 5:30am :P), and I can’t seem to figure out why it is throwing me this error. Thanks

-SRPGHud.h

#pragma once

#include "GameFramework/HUD.h"
#include "SRPGHud.generated.h"

/**
 * 
 */
UCLASS()
class ASRPGHud : public AHUD
{
	GENERATED_UCLASS_BODY()

	TSharedPtr<class SWidgetHealth> WidgetHealth;

	void BeginPlay();
	
};

-SRPGHud.cpp

#include "SimpleRPG.h"
#include "WidgetHealth.h"
#include "SRPGHud.h"


ASRPGHud::ASRPGHud(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)
{

}

void ASRPGHud::BeginPlay() {
	SAssignNew(WidgetHealth, SWidgetHealth).OwnerHUD(this);

	if (GEngine->IsValidLowLevel())
		GEngine->GameViewport->AddViewportWidgetContent(SNew(SWeakWidget).PossiblyNullContent(WidgetHealth.ToSharedRef()));

	if (WidgetHealth.IsValid())
		WidgetHealth.SetVisibility(EVisibility::Visible);
}

-WidgetHealth.h

#pragma once

#include "SRPGHud.h"
#include "Slate.h"

class SWidgetHealth : public SCompoundWidget {
	SLATE_BEGIN_ARGS(SWidgetHealth)
	{}
		SLATE_ARGUMENT(TWeakObjectPtr<ASRPGHud>, OwnerHUD)

	SLATE_END_ARGS()

public:
	void Construct(const FArguments& InArgs);

private:
	TWeakObjectPtr<class ASRPGHud> OwnerHUD;
};

-WidgetHealth.cpp

#include "SimpleRPG.h"
#include "WidgetHealth.h"

void SWidgetHealth::Construct(const FArguments& InArgs) {
	OwnerHUD = InArgs._OwnerHUD;

	ChildSlot
		.VAlign(VAlign_Fill)
		.HAlign(HAlign_Fill)
		[
			SNew(SOverlay)
			+ SOverlay::Slot()
			.VAlign(VAlign_Top)
			.HAlign(HAlign_Center)
			[
				SNew(STextBlock)
				.ShadowColorAndOpacity(FLinearColor::Black)
				.ColorAndOpacity(FLinearColor::White)
				.ShadowOffset(FIntPoint(-1, 1))
				.Font(FSlateFontInfo("Veranda", 16))
				.Text(FText::FromString("Hello, Slate!"))
			]
		];
}

Hey, WidgetHealth is a TSharedPtr which overloads → for you. Try this:

WidgetHealth->SetVisibility(EVisibility::Visible);

wow, I can’t believe I didn’t catch that. thanks!