diff --git a/RoomEscape/Content/NewMap.umap b/RoomEscape/Content/NewMap.umap index 8fdcc89..1681b38 100644 Binary files a/RoomEscape/Content/NewMap.umap and b/RoomEscape/Content/NewMap.umap differ diff --git a/RoomEscape/Content/NewMap_BuiltData.uasset b/RoomEscape/Content/NewMap_BuiltData.uasset index 3a20fa0..f160066 100644 Binary files a/RoomEscape/Content/NewMap_BuiltData.uasset and b/RoomEscape/Content/NewMap_BuiltData.uasset differ diff --git a/RoomEscape/Source/RoomEscape/OpenDoor.cpp b/RoomEscape/Source/RoomEscape/OpenDoor.cpp new file mode 100644 index 0000000..d52b75c --- /dev/null +++ b/RoomEscape/Source/RoomEscape/OpenDoor.cpp @@ -0,0 +1,45 @@ +// Tyrel Souza 2018 + +#include "OpenDoor.h" +#include "GameFramework/Actor.h" // See auto completes + + +// 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(); + + AActor* Owner = GetOwner(); + FString ObjectName = Owner->GetName(); + + + FString Rot = Owner->GetTransform().GetRotation().GetAxisZ().ToString(); + UE_LOG(LogTemp, Warning, TEXT("%s is at: %s"), *ObjectName, *Rot); + + + FRotator NewRotation = FRotator(0.0f, -90.0f, 0.0f); + + Owner->SetActorRotation(NewRotation); + +} + + +// Called every frame +void UOpenDoor::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) +{ + Super::TickComponent(DeltaTime, TickType, ThisTickFunction); + + // ... +} + diff --git a/RoomEscape/Source/RoomEscape/OpenDoor.h b/RoomEscape/Source/RoomEscape/OpenDoor.h new file mode 100644 index 0000000..13f6dee --- /dev/null +++ b/RoomEscape/Source/RoomEscape/OpenDoor.h @@ -0,0 +1,29 @@ +// Tyrel Souza 2018 + +#pragma once + +#include "CoreMinimal.h" +#include "Components/ActorComponent.h" +#include "OpenDoor.generated.h" + + +UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) ) +class ROOMESCAPE_API UOpenDoor : public UActorComponent +{ + GENERATED_BODY() + +public: + // Sets default values for this component's properties + UOpenDoor(); + +protected: + // Called when the game starts + virtual void BeginPlay() override; + +public: + // Called every frame + virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; + + + +};