[ Unreal5 ]/- 언리얼엔진5 실습
언리얼엔진5 c++ socket에 StaticMesh 적용
MRG
2024. 4. 20. 22:00
728x90
반응형
▣ 먼저 Mesh 스켈레톤에 Socket을 추가하고 총을 프리뷰로 가져와서 회전 및 위치를 지정합니다.
▣ StaticMeshComponent를 추가하기 위해 변수를 먼저 선언부에 선언합니다.
▣ StaticMeshComponent 생성 및 상속 그리고 Sock에 상속할 코드를 완성합니다.
▣ AttachToComponent() 함수 매개변수 끝에 SockName을 지정합니다.
https://docs.unrealengine.com/4.27/en-US/API/Runtime/Engine/GameFramework/AActor/AttachToComponent/
AActor::AttachToComponent
Attaches the RootComponent of this Actor to the supplied component, optionally at a named socket.
docs.unrealengine.com
▣ 컴파일 후 플레이를 해보면 손에 총이 따라다니는 걸 확인할 수 있습니다.
728x90
반응형