inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

YoungMin Park님의 게시글

YoungMin Park YoungMin Park

@ggulhouse3019

수강평 작성수
-
평균평점
-

게시글 1

질문&답변

캐릭터가 움직이지 않습니다.

움직이지 않는 문제는 다음과 같이 하시면 해결 하실 수 있습니다. PlayerController.h에 다음 코드 추가 public: virtual void BeginPlay() override; protected: UPROPERTY(EditDefaultsOnly, Category="Input") TObjectPtr DefaultMappingContext; PlayerController.cpp 추가 #include "EnhancedInputSubsystems.h" void ABPlayerController::BeginPlay() { Super::BeginPlay(); if (ULocalPlayer* LP = GetLocalPlayer()) { if (UEnhancedInputLocalPlayerSubsystem* Subsystem = LP->GetSubsystem ()) { if (DefaultMappingContext) { Subsystem->AddMappingContext(DefaultMappingContext, 0); } } } } 그리고 새로 만든 PlayerController C++ 클래스로 BluePrinter로 하나 만들어서 - - DefaultMappingContext에 IMC_Default로 지정 그 후 GameMode로 BP를 사용하도록 지정 하면 캐릭터가 움직이게 됩니다. static ConstructorHelpers::FClassFinder PCRef( TEXT("/Game/Blueprints/Controllers/BP_ABPlayerController.BP_ABPlayerController_C")); if (PCRef.Class) { PlayerControllerClass = PCRef.Class; }

좋아요수
0
댓글수
4
조회수
251