// Fill out your copyright notice in the Description page of Project Settings. #include "MyPlayerController.h" AMyPlayerController::AMyPlayerController() : Super(), isMyTurn(false) { UE_LOG(LogTemp, Warning, TEXT("Player controller created")); } void AMyPlayerController::SetupInputComponent() { Super::SetupInputComponent(); InputComponent->BindAction("MyAction", IE_Pressed, this, &AMyPlayerController::OnLeftMouseClick); } void AMyPlayerController::StartTurn() { isMyTurn = true; UE_LOG(LogTemp, Warning, TEXT("Your turn")); } void AMyPlayerController::EndTurn() { isMyTurn = false; UE_LOG(LogTemp, Warning, TEXT("Not your turn")); } void AMyPlayerController::OnLeftMouseClick() { UE_LOG(LogTemp, Warning, TEXT("Mouse clicked")); FHitResult HitResult; bool IsHitResult = GetHitResultUnderCursorByChannel(TraceTypeQuery1, false, HitResult); UE_LOG(LogTemp, Warning, TEXT("hitted: %s"), IsHitResult ? "Yes" : "No"); }