document.write("
// Copyright Epic Games, Inc. All Rights Reserved. DEFINE_LOG_CATEGORY(LogTemplateCharacter); ADandelionPlayerController::ADandelionPlayerController() { bShowMouseCursor = true; DefaultMouseCursor = EMouseCursor::Default; PathFollowingComponent = CreateDefaultSubobject<UPathFollowingComponent>(TEXT("PathFollowingComponent")); } void ADandelionPlayerController::OnPossess(APawn* InPawn) { Super::OnPossess(InPawn); PathFollowingComponent->Initialize(); } void ADandelionPlayerController::StopMovement() { APawn* PlayerPawn = GetPawn(); if (IsValid(PlayerPawn)) { PlayerPawn->ConsumeMovementInputVector(); } Super::StopMovement(); } void ADandelionPlayerController::SetupInputComponent() { Super::SetupInputComponent(); UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(GetLocalPlayer()); if (!ensure(IsValid(Subsystem))) { UE_LOG( LogTemplateCharacter, Error, TEXT("%s: Attempted to SetupInputComponent with an invalid UEnhancedInputLocalPlayerSubsystem"), *GetFullNameSafe(this) ); return; } for (const UInputMappingContext* MappingContext : DefaultInputMappingContexts) { Subsystem->AddMappingContext(MappingContext, 0); } }