This commit is contained in:
Tyrel Souza 2018-02-20 23:35:22 -05:00
parent 297fe4717c
commit 5473262240
2 changed files with 6 additions and 1 deletions

View File

@ -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()));
@ -49,6 +50,9 @@ void UGrabber::BeginPlay()
void UGrabber::Grab() {
UE_LOG(LogTemp, Warning, TEXT("GRABBING!"));
}
void UGrabber::Release() {
UE_LOG(LogTemp, Warning, TEXT("Released!"));
}
// Called every frame

View File

@ -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
};