Answer the question
In order to leave comments, you need to log in
Why does the game (and editor) crash when showing/hiding the cursor?
Hello.
There is:
MyGamemode, which has Pawn and PlayerController installed by default in something like this:
#include “MyPawn.h”
#include “MyController.h”
DefaultPlayerController = AMyController::StaticClass();
DefaultPawn = AMyPawn::StaticClass();
public:
bool bCursorStatus;
void AMyController::UpdateCursorStatus(bool bNewCursorStatus, EMouseCursor::Type NewCursor);
.h file:
#include “MyController.h”
...
AMyController * GameController;
...
public:
void CursorManagment();
.CPP file:
void AMyPawn::CursorManagment() {
if(GameController->bCursorStatus) {
GameController->UpdateCursorStatus(false, EMouseCursor::Hand);
}
else {
GameController->UpdateCursorStatus(true, EMouseCursor::Hand);
}
GameController->bMouseShowCursor = false;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question