2024.06.04
깃허브! |
---|
★ https://github.com/ChangJin-Lee/SimpleShooter |
고도화를 위해 맵과 게임모드, 3D 모델이 정상적으로 임포트되는지 확인했다.
https://www.youtube.com/watch?v=TkYC4pMIHtY
alsV4의 GameMode와 유데미 강의에서 사용한 GameMode가 달랐다.
Input의 Export, import를 활용하여 입력 매핑을 관리했다.
alsV4의 GameMode에서 쓰이지 않는 매핑은 주석처리했다.
그리고 유데미에서 사용하던 BindAxis와 BindAction을 alsV4에 맞게 cpp 코드도 바꿔주었다.
void AShooterCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
PlayerInputComponent->BindAxis(TEXT("MoveForward/Backwards"), this, &AShooterCharacter::MoveForward);
PlayerInputComponent->BindAxis(TEXT("MoveRight/Left"), this, &AShooterCharacter::MoveRight);
PlayerInputComponent->BindAxis(TEXT("LookUp/Down"), this, &APawn::AddControllerPitchInput);
PlayerInputComponent->BindAxis(TEXT("LookLeft/Right"), this, &APawn::AddControllerYawInput);
// PlayerInputComponent->BindAxis(TEXT("LookUpRate"), this, &AShooterCharacter::LookUpRate);
// PlayerInputComponent->BindAxis(TEXT("LookRightRate"), this, &AShooterCharacter::LookRightRate);
PlayerInputComponent->BindAction(TEXT("JumpAction"), EInputEvent::IE_Pressed, this, &ACharacter::Jump);
PlayerInputComponent->BindAction(TEXT("Shoot"), EInputEvent::IE_Pressed, this, &AShooterCharacter::Shoot);
PlayerInputComponent->BindAction(TEXT("DrawWeapon1"), EInputEvent::IE_Pressed, this, &AShooterCharacter::ChangeWeapon1);
PlayerInputComponent->BindAction(TEXT("DrawWeapon2"), EInputEvent::IE_Pressed, this, &AShooterCharacter::ChangeWeapon2);
}