UE4 - Creating a RPG #5 - Player Healing Ability

노기현·2024년 9월 29일
post-thumbnail

Today's Lesson: Player Healing Ability

Summary

1. In today's video we take a look at how we can setup our player's healing ability, going over step by step how we can do all the blueprint conditioning to see if the player has enough mana then heal and spawn the particle effect if they do.

2. We also go over the process of stopping the character moving whilst they use their player ability.

Virtus Learning Hub


✅ Healing Ability Input 세팅

◼️ Project Settings - Input

  • Action Mappings
    Ability1~9 생성, 키 매핑

✅ Healing Ability Implementation

◼️ Character Blueprint <ThirdPersonCharacter> - Event Graph

  • Ability1 입력, 동일한 애니메이션이 진행 중인지 체크
    New Node: Input Action Ability1
    Input Ability1 → Branch(Casting1H)
    //Casting1H 값이 false인 경우 실행

  • 남은 Mana 체크
    New Node: Branch
    - Float(Get Mana) >= Float
    // [Mana>=0.15] 값이 true인 경우 실행

  • 캐릭터 이동 비활성화, 이동 즉각 멈춤
    Character Movement Component → Disable Movement
    Character Movement Component → Stop Movement Immdediately

  • Mana 소모, Health 회복
    (Float - Float) 노드
    (Float + Float) 노드

  • Casting One Hand Animation 시작, particle 생성
    Set Casting1H: True
    Spawn Emitter at Location
    - Mesh → Get Socket Location(Socket Name: RightFoot)

    RightFoot
    (띄어쓰기 주의!)

  • Delay → Casting One Hand Animation 끝 → 캐릭터 이동 활성화
    Delay: 2(sec)
    Set Casting1H: False
    Get Character Movement → Set Movement Mode: Walking

✅ Result

  • Healing Ability
profile
RPG 기획자 지망생

0개의 댓글