For some reason I’m stuck and I can’t figure out why
Here is my code:
// Copyright Munkhead 2019
#include "OpenDoor.h"
// Sets default values for this component's properties
UOpenDoor::UOpenDoor()
{
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
// off to improve performance if you don't need them.
PrimaryComponentTick.bCanEverTick = true;
// ...
}
// Called when the game starts
void UOpenDoor::BeginPlay()
{
Super::BeginPlay();
}
void UOpenDoor::OpenDoor()
{
//Find the owning Actor
AActor* Owner = GetOwner();
//Create a rotator
FRotator NewRotation = FRotator(0.f, 60.f, 0.f);
//Set the door rotation
Owner->SetActorRotation(NewRotation);
}
// Called every frame
void UOpenDoor::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
// Poll the Trigger Volume
if (PressurePlate->IsOverlappingActor(ActorThatOpens))
{
OpenDoor();
}
}