반응형
GitHub: https://github.com/tyt0815
tyt0815 - Overview
tyt0815 has 4 repositories available. Follow their code on GitHub.
github.com
Notion: https://www.notion.so/tyt0815/a16514d41cb240f08aa19fe5b4c0ab86?pvs=4
언리얼 엔진
Unreal Engine 5 C++ The Ultimate Game Developer Course
www.notion.so
※노션에 기존에 작성하던 글이 있으니 참고
Play Montage
먼저 플레이할 몽타주를 변수로 선언해 줍니다.
UPROPERTY(EditAnywhere, Category = Montage)
UAnimMontage* MyMontage;
그리고 몽타주를 플레이하는 함수를 정의해 줍니다.
void ABaseCharacter::PlayMontageSection(UAnimMontage* Montage, FName SectionName)
{
UAnimInstance* AnimInstance = GetMesh()->GetAnimInstance();
if (AnimInstance && Montage)
{
AnimInstance->Montage_Play(Montage);
AnimInstance->Montage_JumpToSection(SectionName, Montage);
}
}
위 함수에 Montage변수와 SectionName를 파라미터로 주면 사용할 수 있습니다.
PlayMontageSection(MyMontage, "Attack2");
컴파일하고 블루프린트 편집기로 와서 몽타주를 설정해 줍니다.
설정된 몽타주는 아래와 같습니다. 아래에 밑줄친 "Attack2"섹션이 플레이 될 것 입니다.
플레이해서 확인해 봅니다.
반응형
'언리얼 엔진 > 기초' 카테고리의 다른 글
[Unreal Engine5] 무기 매커니즘 만들기(1) - Box Trace (0) | 2023.08.24 |
---|---|
[Unreal Engine5] 이동 + 공격 상하체 따로 움직이기(Layered blend per bone) (0) | 2023.08.23 |
[Unreal Engine5] IK Rig와 IK Retargeter를 이용한 서로 다른 3D 모델의 애니메이션 사용하기 (0) | 2023.08.16 |
[Unreal Engine5] Mixamo에서 3D에셋 다운받아 활용하기(with blender) (0) | 2023.08.16 |
[Unreal Engine5] Game Feature 시스템 기초(3) (0) | 2023.08.14 |