I found a weird behavior that I am trying to understand. The following code causes my widget which is set in the blueprint and used in c++ to be null:
FTimerHandle UITimer;
/** The widget class we will use as our menu when the game starts. */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UMG Game")
TSubclassOf<UUserWidget> StartingWidgetClass;
/** The widget instance that we are using as our menu. */
UPROPERTY()
UUserWidget* CurrentWidget;
But this one works, only by declaring a timer below. Is it a bug? Or why does it happen?
/** The widget class we will use as our menu when the game starts. */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UMG Game")
TSubclassOf<UUserWidget> StartingWidgetClass;
/** The widget instance that we are using as our menu. */
UPROPERTY()
UUserWidget* CurrentWidget;
FTimerHandle UITimer;