너는 언리얼 엔진 5.6, C++ 기반 시스템을 설계하고 구현하는 전문가다. 다음 요구사항을 기반으로 한 번에 전체 그래플링 훅(Grappling Hook) 시스템을 완성된 코드로 제공하라.
===========================
1) 기능 요약
===========================
플레이어가 마우스 우클릭을 하면 카메라 중심에서 Forward 방향으로 LineTrace를 발사한다.
- InteractionSystem::PerformCenterLineTrace() 같은 형태로 레이캐스트를 할 수 있다.
닿은 Actor가 UHookComponent 를 보유하고 있으면
→ PlayerActor 내부의 UHookSystem 이 그 Actor를 플레이어 앞으로 끌어온다.
블리츠크랭크 Q(훅 끌어오기)와 동일한 구조:
- 훅이 날아가서 맞으면
- 대상 Actor가 끌려온다
===========================
2) 클래스 구성 요구사항
===========================
2-1. UHookComponent
- Actor에 붙으면 “그래플링 가능 대상”임을 표시하는 태그 역할
- 실제 물리 이동 처리는 HookSystem이 수행
- 필요한 프로퍼티:
- bIsHookable
- Optional: HookAttachOffset
2-2. UHookSystem (PlayerActor에 장착)
- 역할: 그래플링 훅 전체 로직 처리
- 기능:
- Hook 대상 저장: AActor* HookedTarget
- Hook 시작: StartHook(FHitResult Hit)
- 대상 끌어오기: Tick에서 이동 보간
- Hook 해제: ReleaseHook()
- 이동 방식:
- FVector TargetLocation = PlayerActor->GetActorLocation() + Forward * DesiredDistance;
- 대상 Actor의 위치를 FMath::VInterpTo 로 이동
- RPC 필요 없음 (로컬 싱글 플레이 기준)
- 안전 처리:
- 대상이 없어지면 자동 ReleaseHook
- 너무 가까워지면 conclude
2-3. UInteractionSystem (이미 있음)
- PerformCenterLineTrace(FHitResult& OutHit) 제공
- HookSystem에서 호출해서 Hit 결과 활용
2-4. PlayerActor (ACharacter)
- InputComponent에서 RightMouseButton → HookSystem->TryHook()
- 멤버:
- UPROPERTY() UInteractionSystem* InteractionSystem;
- UPROPERTY() UHookSystem* HookSystem;
===========================
3) 작동 흐름
===========================
- Player 우클릭 입력 발생
- InteractionSystem.PerformCenterLineTrace() 호출
- Hit된 Actor가 UHookComponent 를 가지고 있으면
- HookSystem.StartHook(HitResult)
- HookSystem.TickComponent() 에서 대상 Actor를 플레이어 앞으로 천천히 끌어오기
- 일정 거리 이하가 되면 끌어오기 종료(ReleaseHook)
===========================
4) 구현 상세 요구사항
===========================
A) UHookComponent
- 단순 Marker
- BlueprintSpawnableComponent
- bool bIsHookable = true;
B) UHookSystem
반드시 아래 메서드를 구현한다: