본문 바로가기

공부/Unreal5

Unreal Component nullptr 문제

스코프를 추가하고 스나이퍼라이플을 장착하려는데 장착이되지않아

디버깅으로 확인을해보니 component가 nullptr이었던 문제가 발생했다.

 

https://forums.unrealengine.com/t/c-uproperty-actor-component-variable-being-set-to-null/413170/7

 

C++ UPROPERTY actor component variable being set to null

I had the same problem, but changing tags in the UPROPERTY did not fix it. I ended up having to change the name of the component variable. PlayerEquipment = CreateDefaultSubobject<UEquipmentComponent>(TEXT("PlayerEquipment")); to PlayerEquipment2 = CreateD

forums.unrealengine.com

 

 

1. Component 변수명을 수정

2. 블루프린트를 새로 만들기

 

) Component는 Get함수로 접근을 해야겠다.. 1번방법으로 해결