AzureAbyss/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp
MH261677 846b21e4e9 Fixed Interaction Pop-Ups
Interaction is now working with the merchant also added interaction class to setup this up.
2022-11-13 16:43:01 +00:00

38 lines
785 B
C++

// Fill out your copyright notice in the Description page of Project Settings.
#include "Interaction.h"
#include "Components/WidgetComponent.h"
// Sets default values
AInteraction::AInteraction()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
WidgetBase = CreateDefaultSubobject<UWidgetComponent>(TEXT("Widget Base Class"));
}
// Called when the game starts or when spawned
void AInteraction::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void AInteraction::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
void AInteraction::OnInteract()
{
auto spawnedWidget = CreateWidget<UUserWidget>(GetWorld(), Widget);
spawnedWidget->AddToViewport(0);
}