included the input mapping contexts to character.cpp and playercharaccontroller.cpp. need to replace the interact to character
This commit is contained in:
parent
c956bf2978
commit
264db39cc1
@ -4,6 +4,7 @@
|
|||||||
#include "HYPlayerCharacController.h"
|
#include "HYPlayerCharacController.h"
|
||||||
#include "HYGameStateBase.h"
|
#include "HYGameStateBase.h"
|
||||||
#include "hwanyoung2Character.h"
|
#include "hwanyoung2Character.h"
|
||||||
|
#include "EnhancedInputComponent.h"
|
||||||
|
|
||||||
AHYPlayerCharacController::AHYPlayerCharacController()
|
AHYPlayerCharacController::AHYPlayerCharacController()
|
||||||
{
|
{
|
||||||
@ -48,9 +49,15 @@ void AHYPlayerCharacController::SetupInputComponent()
|
|||||||
{
|
{
|
||||||
Super::SetupInputComponent();
|
Super::SetupInputComponent();
|
||||||
|
|
||||||
InputComponent->BindAction(
|
if (UEnhancedInputComponent* EnhancedInputComponent = CastChecked<UEnhancedInputComponent>(InputComponent)) {
|
||||||
"Interact", IE_Pressed, this,
|
EnhancedInputComponent->BindAction(
|
||||||
&AHYPlayerCharacController::Interact);
|
InteractAction, ETriggerEvent::Triggered,
|
||||||
|
this, &AHYPlayerCharacController::Interact);
|
||||||
|
EnhancedInputComponent->BindAction(
|
||||||
|
ToggleInventoryAction, ETriggerEvent::Triggered,
|
||||||
|
this, &AHYPlayerCharacController::ReloadInventory);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AHYPlayerCharacController::OnPossess(APawn* InPawn)
|
void AHYPlayerCharacController::OnPossess(APawn* InPawn)
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include "HYInteractableActor.h"
|
#include "HYInteractableActor.h"
|
||||||
#include "InventoryItem.h"
|
#include "InventoryItem.h"
|
||||||
|
#include "InputAction.h"
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "GameFramework/PlayerController.h"
|
#include "GameFramework/PlayerController.h"
|
||||||
#include "HYPlayerCharacController.generated.h"
|
#include "HYPlayerCharacController.generated.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user