Updated TempCharacter.cpp, Interaction.cpp
Added a function which can be called from blueprints to re-enable all input once a button is pressed Fixed interaction boolean to reset itself back to false to make it so player can talk to NPC again without having to restart the game to interact with it.
This commit is contained in:
parent
e7fa8f4c63
commit
52639d9af6
@ -59,5 +59,6 @@ void AInteraction::RemoveWidget()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
ItemSelectorWidget->AddToViewport(0);
|
ItemSelectorWidget->AddToViewport(0);
|
||||||
|
bisDisabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -124,8 +124,21 @@ void ATempCharacter::LineTraceLogic()
|
|||||||
void ATempCharacter::InputDisabler()
|
void ATempCharacter::InputDisabler()
|
||||||
{
|
{
|
||||||
UE_LOG(LogTemp, Display, TEXT("Disabling playermovement"));
|
UE_LOG(LogTemp, Display, TEXT("Disabling playermovement"));
|
||||||
GetWorld()->GetFirstPlayerController()->SetIgnoreLookInput(false);
|
GetWorld()->GetFirstPlayerController()->SetIgnoreLookInput(true);
|
||||||
GetWorld()->GetFirstPlayerController()->SetIgnoreMoveInput(true);
|
GetWorld()->GetFirstPlayerController()->SetIgnoreMoveInput(true);
|
||||||
|
GetWorld()->GetFirstPlayerController()->bShowMouseCursor = true;
|
||||||
|
GetWorld()->GetFirstPlayerController()->bEnableClickEvents = true;
|
||||||
|
GetWorld()->GetFirstPlayerController()->bEnableMouseOverEvents = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ATempCharacter::InputEnabler()
|
||||||
|
{
|
||||||
|
UE_LOG(LogTemp, Display, TEXT("Enabling Inputs"));
|
||||||
|
GetWorld()->GetFirstPlayerController()->SetIgnoreLookInput(false);
|
||||||
|
GetWorld()->GetFirstPlayerController()->SetIgnoreMoveInput(false);
|
||||||
|
GetWorld()->GetFirstPlayerController()->bShowMouseCursor = false;
|
||||||
|
GetWorld()->GetFirstPlayerController()->bEnableClickEvents = false;
|
||||||
|
GetWorld()->GetFirstPlayerController()->bEnableMouseOverEvents = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ATempCharacter::UseItem(class UBaseItem* Item)
|
void ATempCharacter::UseItem(class UBaseItem* Item)
|
||||||
@ -137,3 +150,5 @@ void ATempCharacter::UseItem(class UBaseItem* Item)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,4 +54,7 @@ public:
|
|||||||
UFUNCTION(BlueprintCallable, Category= "Items")
|
UFUNCTION(BlueprintCallable, Category= "Items")
|
||||||
void UseItem(class UBaseItem* Item); // Overriding the BaseItem Class
|
void UseItem(class UBaseItem* Item); // Overriding the BaseItem Class
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable)
|
||||||
|
void InputEnabler();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user