Why when the game is paused, the input devices (mouse and keyboard)
it working OK. But when it is in “play” mode does not work?
When my game is in PLAY MODE
MOUSE AND KEYBOARD DONT WORK.
When my game is in PAUSE MODE
MOUSE AND KEYBOARD WORK PERFECT !!!
I dont understand why.
Please help me.
Thank you, best regards.
In te PlayerController Constructor
ABatallaPlayerController::ABatallaPlayerController(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
bShowMouseCursor = true;
bEnableClickEvents = true;
bEnableTouchEvents = true;
bEnableMouseOverEvents = true;
bEnableTouchOverEvents = true;
DefaultMouseCursor = EMouseCursor::Crosshairs;
}
Hello, Frankgrandson
Please make sure that your Player Controller class is selected as Player Controller class in your project.
To do this, in the Editor you should go to Edit - Project Settings - Maps & Modes - Default Modes - Player Controller class.
Hope this helped!
Good luck!
Hi Melnick,
Thanks for reply.
This is the GameMode constructor:
ABatallaGameMode::ABatallaGameMode(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
// DefaultPawnClass = NULL;
DefaultPawnClass = AMyPawn::StaticClass();
HUDClass = AMyHUD::StaticClass();
Juego = new game();
// use our own player controller class
PlayerControllerClass = ABatallaPlayerController::StaticClass();
}
This is the player Conroller Constructor:
ABatallaPlayerController::ABatallaPlayerController(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
bShowMouseCursor = true;
bEnableClickEvents = true;
bEnableTouchEvents = true;
bEnableMouseOverEvents = true;
bEnableTouchOverEvents = true;
DefaultMouseCursor = EMouseCursor::Crosshairs;
}
This is the configuration screenshot:
Any suggestions?
What I should do?
I changed everything I could and nothing happens.
I change this:
void ABatallaPlayerController::Tick(float DeltaTime) {
if(WasInputKeyJustPressed(EKeys::A))
{
int a = 100;
}
//EKeys::SpaceBar
}
to this:
void ABatallaPlayerController::Tick(float DeltaTime) {
Super::Tick(DeltaTime);
if(WasInputKeyJustPressed(EKeys::A))
{
int a = 100;
}
//EKeys::SpaceBar
}
And ALL is OK now. Thank you!!
Best regards.
In my custom Player Controller Class I change the tick Funtion:
From:
void ABatallaPlayerController::Tick(float DeltaTime) {
if(WasInputKeyJustPressed(EKeys::A))
{
}
}
to:
void ABatallaPlayerController::Tick(float DeltaTime) {
Super::Tick(DeltaTime);
if(WasInputKeyJustPressed(EKeys::A))
{
}
}
Now everything is OK.
Thank you, best regards.