diff --git a/RoomEscape/Content/NewMap.umap b/RoomEscape/Content/NewMap.umap index 51945c9..578c803 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 ccb9fc2..43a7508 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 404faed..137b9e7 100644 --- a/RoomEscape/Source/RoomEscape/Grabber.cpp +++ b/RoomEscape/Source/RoomEscape/Grabber.cpp @@ -31,7 +31,7 @@ void UGrabber::TickComponent(float DeltaTime, ELevelTick TickType, FActorCompone { Super::TickComponent(DeltaTime, TickType, ThisTickFunction); - // Get player View point in this tick + /// Get player View point in this tick FVector PlayerViewpointLocation; FRotator PlayerViewpointRotation; GetWorld()->GetFirstPlayerController( @@ -53,23 +53,26 @@ void UGrabber::TickComponent(float DeltaTime, ELevelTick TickType, FActorCompone 5.0f ); - //UE_LOG(LogTemp, - // Warning, - // TEXT("Location: %s Rotation: %s"), - // *PlayerViewpointLocation.ToString(), - // *PlayerViewpointRotation.ToString() - //); + ///Setup Query Parameters + FCollisionQueryParams TraceParameters(FName(TEXT("")), false, GetOwner()); - //UE_LOG(LogTemp, - // Warning, - // TEXT("LineTraceEnd: %s"), - // *LineTraceEnd.ToString() - //); + /// Line-Trace (Ray-Cast) out to reach distance + FHitResult Hit; + GetWorld()->LineTraceSingleByObjectType( + OUT Hit, + PlayerViewpointLocation, + LineTraceEnd, + FCollisionObjectQueryParams(ECollisionChannel::ECC_PhysicsBody), + TraceParameters + ); - // Ray-Cast out to reach distance + AActor* ActorHit = Hit.GetActor(); + if (ActorHit) { + UE_LOG(LogTemp, Warning, TEXT("Line Tract Hit: %s"), *(ActorHit->GetName())); + } - // See what we hit + /// See what we hit