From 5473262240d54eb1044f83b1d4f5d1e8b5e7a2b6 Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Tue, 20 Feb 2018 23:35:22 -0500 Subject: [PATCH] release --- RoomEscape/Source/RoomEscape/Grabber.cpp | 6 +++++- RoomEscape/Source/RoomEscape/Grabber.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/RoomEscape/Source/RoomEscape/Grabber.cpp b/RoomEscape/Source/RoomEscape/Grabber.cpp index cf1f051..4aa0ea4 100644 --- a/RoomEscape/Source/RoomEscape/Grabber.cpp +++ b/RoomEscape/Source/RoomEscape/Grabber.cpp @@ -38,6 +38,7 @@ void UGrabber::BeginPlay() UE_LOG(LogTemp, Warning, TEXT("%s has a InputHandle"), *(GetOwner()->GetName())); InputComponent->BindAction("Grab", IE_Pressed, this, &UGrabber::Grab); + InputComponent->BindAction("Grab", IE_Released, this, &UGrabber::Release); } else { UE_LOG(LogTemp, Error, TEXT("%s has no InputHandle"), *(GetOwner()->GetName())); @@ -46,9 +47,12 @@ void UGrabber::BeginPlay() } // Raycast and grab what is in reach -void UGrabber::Grab(){ +void UGrabber::Grab() { UE_LOG(LogTemp, Warning, TEXT("GRABBING!")); } +void UGrabber::Release() { + UE_LOG(LogTemp, Warning, TEXT("Released!")); +} // Called every frame diff --git a/RoomEscape/Source/RoomEscape/Grabber.h b/RoomEscape/Source/RoomEscape/Grabber.h index a2aacd5..d588c28 100644 --- a/RoomEscape/Source/RoomEscape/Grabber.h +++ b/RoomEscape/Source/RoomEscape/Grabber.h @@ -27,4 +27,5 @@ private: UPhysicsHandleComponent* PhysicsHandle = nullptr; UInputComponent* InputComponent = nullptr; void Grab(); // Raycast and grab what is in reach + void Release(); // Raycast and grab what is in reach };