How To Create Fall Damage In Unreal Engine 5 (Tutorial)

Sdílet
Vložit
  • čas přidán 1. 07. 2024
  • Hey guys, in today's video I'm going to be showing you how to create a fall damage system in Unreal Engine 5. This system is very easy to customise for yourself, whether it is the height, speed, differing damage types or damage amount.
    How To Damage And Heal The Player: • How To Damage And Heal...
    How To Create A Health Bar: • How To Make A Health B...
    Speed Based Fall Damage: • Fall Damage - Unreal E...
    #UE5 #UnrealEngine5 #UE5Tutorial
    ___________________________________________________________________________
    00:00 - Intro
    00:23 - Overview
    01:16 - Tutorial
    08:04 - Final Overview
    08:45 - Outro
    ___________________________________________________________________________
    If you enjoy make sure to subscribe: / @mattaspland
    Join My Discord Server: / discord
    Follow Me On Twitter: / matt_aspland
    Follow Me On Instagram: / matt_aspland_
    All My Social Media Links: linktr.ee/MattAspland
    ___________________________________________________________________________
    If you want to support me, there are many different ways of doing so. This is by no means expected or required. It is just a nice support :)
    Patreon: / mattaspland
    PayPal: paypal.me/mattaspland?country...
    Ko-Fi: ko-fi.com/mattaspland
    Thank you :)
    ___________________________________________________________________________
    To access the project files and screenshots from the video, check out my Patreon above!
    My Public Video List: trello.com/b/7vJgXzBm
    Unreal Engine 4 Tutorials Playlist: • Unreal Engine 4 Tutorials
    The Basics Of Nodes Playlist: • The Basics Of Nodes In...
    ___________________________________________________________________________
    ♫Outro Song♫
    ●Kronicle - Chill Noons

Komentáře • 30

  • @kevinhermi
    @kevinhermi Před rokem +6

    you could also just use the "OnLanded" Event on your Character. Check what the velocity (Get Velocity and extract the Z value) at the moment of impact was and apply an appropriate amount of damage.

  • @TrojanLube69
    @TrojanLube69 Před 2 lety +12

    So this is based on time fall damage and not actually distance fall based damage.
    On the other side you could calculate the z axis fall when character switches to is falling. No need for a delay, So it will accurately calculate based on the exact distance that the player fell. Because if player is glitched and character is in air lets say a mesh glitches the player, by time based it will kill them if glitch/engine moves character to prevent collision overlap, even during spawn this could happen. If distance based, it will just calculate based on a position variable set during it first trigger is falling and compare it to where it ended and caculate damage based on your multiplier damage calculation by the amount of Z difference.

    • @sulphurous2656
      @sulphurous2656 Před rokem

      What about velocity based fall damage?

    • @TrojanLube69
      @TrojanLube69 Před rokem

      @@sulphurous2656 is pretty much the same as above. You calculate z velocity from an initial stored point when character movement was set to is falling. Then you normalize the value. You could even then calculate a safe distance to not cause damage if within that parameter.
      Is best if you use a timer event to check every half second or second if player is falling. After begin play. No tick necessary.

  • @kraulim
    @kraulim Před 2 lety +2

    i was looking for it today man!

  • @djsalis
    @djsalis Před rokem

    Great Video! thx :)

  • @wesss9353
    @wesss9353 Před 2 lety +1

    Great video!
    Are you having fun on holiday

  • @emir_turkolmez
    @emir_turkolmez Před 10 měsíci

    00:58 The custom death sound was gold 😂😂

  • @UnrealART
    @UnrealART Před 2 lety

    👍👍👌

  • @dylansiracusan9490
    @dylansiracusan9490 Před měsícem

    Hey @matt , i'm finding this video late... I have a double jump implemented in my game and was wondering if there is a way to reset the falling timer so that it doesnt kill the player if they are double jumping....

  • @karenrogregez1670
    @karenrogregez1670 Před 2 lety

    Will you please show us how to make a game with rail shooters just like in house of the dead

  • @wtfmiki
    @wtfmiki Před 9 měsíci

    i found a bug when you land if you jump again quick you die is like the timmer keep count on landed

  • @Synth679
    @Synth679 Před rokem

    Hey i followed your Glider tutorial from a year back and with this fall damage i instantly die after i hit the ground. How could i prevent fall damage if im using the glider?

  • @Alex_Panagiotidis7
    @Alex_Panagiotidis7 Před 2 lety +3

    Hey can you please make unlimited levels?
    (Like when you end one level it will automatically open a new random level)

  • @Noobsed
    @Noobsed Před 2 lety +3

    You are amazing

  • @moneyman4898-
    @moneyman4898- Před rokem

    Does this work with the LYRA template?

  • @BroccoSiffredi21
    @BroccoSiffredi21 Před měsícem

    why not do it in a while loop ?

  • @MartKart8
    @MartKart8 Před 2 lety +1

    The only issue I have with damage system is for a first person character, I created the ability to take damage, if the projectile is large and hits the player the player takes damage, yet if the projectile is small, the character doesn't take any damage.
    There's nothing wrong with the code, it's not seeming to read the hit, even when it hits the character?

    • @TrojanLube69
      @TrojanLube69 Před 2 lety +1

      Make sure it has CCD - continuous collision detection if it’s very small. I think that’s how it’s called. You could on the other hand to avoid so much resources being taken, have small mesh visible with no collision, and attach a collision component (not visible) bigger than the mesh that is the one used for damage calculation.

    • @MartKart8
      @MartKart8 Před 2 lety

      @@TrojanLube69 I've never heard of continuous collision detection, I'll try the second one, might mess it up though.

    • @MartKart8
      @MartKart8 Před 2 lety

      @@TrojanLube69 I feel daft sometimes, resizing the sphere Collision, fixed the blast radius, for the Guardian

    • @TrojanLube69
      @TrojanLube69 Před 2 lety

      @@MartKart8 it’s been a while since I used the engine, it should be provided in the physics/collision settings of all static meshes. Although I heard UE5 deprecated the nvidia physics engine and adopted their chaos. So, chaos might provide a similar function/option.
      I wish I could be more help but the second option should work well regardless. Most studios use that approach anyways to compensate for network packet loss, netcode, and/or latency.

    • @MartKart8
      @MartKart8 Před 2 lety

      @@TrojanLube69 I'm using the same code for both third person and first person, for the Third person, the damage would always work, yet for First person, I used the exact same Sphere radius size "32" and fail, I went and made it 100 and it works, I gave it a Niagara effect (Based on the bomb blast from The Legend of Zelda game series), a sound effect and set it to destroy itself when it hit a target.
      I did spot a version called Chaos in Unreal, but never touched it.
      I would like to use UE5, but the computer doesn't appear to use the recommend specs?

  • @ue4warriorandroidproject961

    Ve health zero death olay animation system olease

  • @Im_pro_true16
    @Im_pro_true16 Před 2 lety

    does this work in ue4?

  • @chankulovski
    @chankulovski Před rokem

    I did exactly everything like in the video, it doesn't work :( I tried with Third Person and First Person ... I have no idea why it doesn't work :@

    • @GrimR3apa1102
      @GrimR3apa1102 Před rokem +1

      if you have a healthbar system that requires you to update it, you may need to call on the object reference and get the update health message but the reason this doesnt work, is that it triggers even before the player hits the .1 second mark

    • @chankulovski
      @chankulovski Před rokem

      @@GrimR3apa1102 Thank you for your kind help :)

  • @ue4warriorandroidproject961

    Brother damage play anım montage