diff --git a/RoomEscape/Content/NewMap.umap b/RoomEscape/Content/NewMap.umap index d643376..85391d5 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 6273f8c..72c2210 100644 Binary files a/RoomEscape/Content/NewMap_BuiltData.uasset and b/RoomEscape/Content/NewMap_BuiltData.uasset differ diff --git a/RoomEscape/Source/RoomEscape/Grabber.cpp b/RoomEscape/Source/RoomEscape/Grabber.cpp index 4f9a412..404faed 100644 --- a/RoomEscape/Source/RoomEscape/Grabber.cpp +++ b/RoomEscape/Source/RoomEscape/Grabber.cpp @@ -3,6 +3,7 @@ #include "Grabber.h" #include "Engine/World.h" #include "GameFramework/Actor.h" +#include "Public/DrawDebugHelpers.h" #define OUT @@ -39,14 +40,32 @@ void UGrabber::TickComponent(float DeltaTime, ELevelTick TickType, FActorCompone OUT PlayerViewpointRotation ); + FVector LineTraceEnd = PlayerViewpointLocation + PlayerViewpointRotation.Vector() * Reach; - UE_LOG(LogTemp, - Warning, - TEXT("View Point at %s rotating %s"), - *PlayerViewpointLocation.ToString(), - *PlayerViewpointRotation.ToString() + DrawDebugLine( + GetWorld(), + PlayerViewpointLocation, + LineTraceEnd, + FColor(255, 0, 0), + false, + 0.f, + 0, + 5.0f ); + //UE_LOG(LogTemp, + // Warning, + // TEXT("Location: %s Rotation: %s"), + // *PlayerViewpointLocation.ToString(), + // *PlayerViewpointRotation.ToString() + //); + + //UE_LOG(LogTemp, + // Warning, + // TEXT("LineTraceEnd: %s"), + // *LineTraceEnd.ToString() + //); + // Ray-Cast out to reach distance diff --git a/RoomEscape/Source/RoomEscape/Grabber.h b/RoomEscape/Source/RoomEscape/Grabber.h index 29b199e..f068888 100644 --- a/RoomEscape/Source/RoomEscape/Grabber.h +++ b/RoomEscape/Source/RoomEscape/Grabber.h @@ -24,6 +24,8 @@ public: // Called every frame virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; - +private: + float Reach = 100.f; + }; diff --git a/RoomEscape/Source/RoomEscape/OpenDoor.h b/RoomEscape/Source/RoomEscape/OpenDoor.h index 02e98c9..b9e07da 100644 --- a/RoomEscape/Source/RoomEscape/OpenDoor.h +++ b/RoomEscape/Source/RoomEscape/OpenDoor.h @@ -40,4 +40,5 @@ private: AActor* ActorThatOpens; AActor* OwningDoor; + };