Created
July 15, 2017 22:30
-
-
Save ThomasAunvik/54af75dffe860c6a294d76d5d717a074 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyrighted by Thaun Corp © | |
#include "CoreMinimal.h" | |
#include "Engine/TriggerVolume.h" | |
#include "Engine/World.h" | |
#include "Components/ActorComponent.h" | |
#include "OpenDoor.generated.h" | |
UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent)) | |
class LEARNUNREAL_API UOpenDoor : public UActorComponent | |
{ | |
GENERATED_BODY() | |
public: | |
// Sets default values for this component's properties | |
UOpenDoor(); | |
// Called when the game starts | |
virtual void BeginPlay() override; | |
void OpenDoor(); | |
// Called every frame | |
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; | |
private: | |
UPROPERTY(VisibleAnywhere) | |
float OpenAngle = 90.0f; | |
UPROPERTY(EditAnywhere) | |
ATriggerVolume* PressurePlate; | |
AActor* ActorThatOpens; // Remembers pawn inherits from actor | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment