캐릭터가 물건을 잡기 위한 Physics Handle 을 캐릭터에 부여하는 과정에서

 

1차 시도

PhysicsHandle = GetOwner()->FindComponentByClass<UPhysicsHandleComponent>();

BeginPlay에서 캐릭터 블루프린트의 Physic Handle 의 이름과 스크립트에서의 이름이 같으니 충돌이 났고,

이름을 다르게 하니까 서로 인식을 못 했다

 

2차 시도

characterPhysicsHandle = CreateDefaultSubobject<UPhysicsHandleComponent>(TEXT("UPhysicsHandleComponent"));

생성자에서 이름을 다르게 하고, 블루프린트에 있는 Phsycis Handle을 불러와서 쓰려고 했으나 실패

 

3차 시도

characterPhysicsHandle = this->FindComponentByClass<UPhysicsHandleComponent>();

BeginPlay에서...

첫 번째 시도의 GetOwner()가 잘못됐음을 깨달음

요상한... Pawn 이 들어왔었나 여튼 의도와 다른 애를 가져오더라

this(현재 객체)로 바꿔주니 해결...

 

 

'[햄] 작업일기' 카테고리의 다른 글

230711  (0) 2023.07.11
230706  (0) 2023.07.07
230625-230627  (0) 2023.06.24
230616  (0) 2023.06.16
230615  (0) 2023.06.15

+ Recent posts