# GetCapsuleComponent error

**URL:** <https://forums.unrealengine.com/t/getcapsulecomponent-error/264670>\
**Category:** 한국어 (Korean)\
**Tags:** General, unreal-engine\
**Created:** [December 7, 2021, 6:25pm UTC](https://forums.unrealengine.com/t/getcapsulecomponent-error/264670 "2021-12-07T18:25:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![skamo3](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/skamo3/32/88714_2.png) [@skamo3](https://forums.unrealengine.com/u/skamo3)\
**Post date:** [December 7, 2021, 6:25pm UTC](https://forums.unrealengine.com/t/getcapsulecomponent-error/264670/1 "2021-12-07T18:25:24Z")

</div>

Unreal Engine 4.x By Example 책을 따라가며 공부중인데  
어떤 방법을 써도 GetCapsuleComponent() 아래의 빨간 줄이 사라지질 않습니다  
헤더의 문제인가 했는데 헤더는 정상적으로 선언되어있고  
GetCapsuleComponent 함수의 정의를 가봐도 절대 에러가 날 수 없는 부분인데 왜 계속 에러인지 모르겠네요…

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/8/e/8e20af2a02bb9f11ddb424a57cd923ea1d2aac98.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/7/5/75e5bc1ef4569334f9d6e29bef19edf0c7eac073.png)

다른 예제들을 봐도 GetCapsuleComponent는 저렇게 가져다 사용하는데 뭐가 문제일까요?

---

<div class="post-metadata">

**Author:** ![Anonymous\_b8590124224f3d5664fa221d5ce243e7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_b8590124224f3d5664fa221d5ce243e7](https://forums.unrealengine.com/u/Anonymous_b8590124224f3d5664fa221d5ce243e7)\
**Post date:** [March 1, 2022, 3:45am UTC](https://forums.unrealengine.com/t/getcapsulecomponent-error/264670/2 "2022-03-01T03:45:04Z")

</div>

안녕하세요 해당 에러를 해결하셨는지 모르겠지만 GetCapsuleComponent() 관련 에러를 제가 해결해서 혹시나 같은 내용일까 싶어서 남깁니다. Character 헤더파일을 보시면 class UCapsuleComponent가 전방선언되어있어서 해당 형식포인터를 사용할 수는 있게 되어있습니다. 그 상태에서 내부 함수에선 멤버로 갖는 CapsuleComponent 포인터를 반환합니다. 그렇기에 결론만 말씀드리면 저 포인터에서 어떤 내용이 있는지 모르기때문에 에러를 뱉고 있는게 아닐까요?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/5/9/b596c449f315f4b5e6d53670b8eb6fd245f4c1ef.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/b/b/8bbd53b4f98bafb836e0b04b308976a035956878.png)  
전 필요한 곳에 CapsuleComponent.h룰 추가해서 구체적인 내용을 알게 열어주었더니 에러 사라지더라구요
