Unreal C++ Course Chapter 114 – 115.

작성자

카테고리:

← 피드로
DEV Community · Liquefier · 2026-09-26 개발(SW)

Liquefier

Very straight forward blueprint and C++ use of attack montages, I also included a check to see if the character state was unequipped, which looks like it will be the next lesson. (I tend to get ahead of myself)


void AEchoCharacter::EchoAttack()
{
    UAnimInstance* AnimInstance = GetMesh()->GetAnimInstance();
    if (AnimInstance && AttackMontage && CurrentEquipState != ECharacterEquipState::ECS_UnEquipped)
    {
        AnimInstance->Montage_Play(AttackMontage);
        int32 selection = FMath::RandRange(0, 1);

        switch (selection)
        {
        case 0:
            AnimInstance->Montage_JumpToSection("Attack1", AttackMontage);
            break;
        case 1:
            AnimInstance->Montage_JumpToSection("Attack2", AttackMontage);
            break;
        }

Enter fullscreen mode Exit fullscreen mode

원문에서 계속 ↗