Announcement

Collapse
No announcement yet.

Looking for fall damage tutorial

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Looking for fall damage tutorial

    I looking for a good and short fall damage tutorial
    I saw some on youtube, but most were like the bps already done and very long
    The only one I saw that was small and did from the beginning
    Did not work for me

    So if anyone knows of a tutorial in video or images, I would be very grateful

    #2
    Take a look at this thread discussing fall damage.

    Hope it helps.

    Comment


      #3
      That's time based which is offer is fine for single jump etc but what if we're talking multi jump. Guess it'd hafta be reset each jump but could reset the time each jump.

      What about on jump you set current actor location vector and on land compair the distance on Z axis. Then based on a distance you want damage to apply do so
      Inphidel / Brian - Developer of Ultraball
      http://www.ultraballgame.com

      Don't shy away from bugs in your game. Don't play it as intended. Break your game so you can fix it!

      Comment


        #4
        Actually the location would need to be determined when player starts moving down.
        Inphidel / Brian - Developer of Ultraball
        http://www.ultraballgame.com

        Don't shy away from bugs in your game. Don't play it as intended. Break your game so you can fix it!

        Comment


          #5
          Just a thought, start a timer that begins when the player character reaches a certain negative Y velocity.

          Comment


            #6
            [MENTION=726941]GuilhermeAU[/MENTION]

            Made a little video for you. There are many different implementations you can use, so you don't need to use my particular method, but it might give you an idea, how to handle this stuff .
            NOTE: The text, which is printed last is a negative value. That is, because my health value wasn't big enough to sustain the amount of damage caused by the fall. What you do with the math is up to yourself. You can cap the "Z-value" with a "clamp (float)" value, if you want to have a limit, how much damage can be applied maximally.

            https://vid.me/jxbT

            Hope I could be of help.
            Main channel:
            https://www.youtube.com/channel/UCGC...o9s3YcA/videos

            Comment


              #7
              If you want to be realistic, Damage should be determined by the Velocity, not the Distance or Time you traveled in air.

              Comment


                #8
                Click image for larger version

Name:	Screenshot 2017-03-31 18.11.16.png
Views:	1
Size:	312.6 KB
ID:	1125846

                Heres what i did tooling around before leaving work,

                enjoy
                Inphidel / Brian - Developer of Ultraball
                http://www.ultraballgame.com

                Don't shy away from bugs in your game. Don't play it as intended. Break your game so you can fix it!

                Comment


                  #9
                  So I tried both methods thanks who helped me
                  But there is a problem
                  I want fall damage that takes into account my life.
                  Because when I go to test it's hit kill, I lose my whole life at any altitude
                  If I jump I lose my whole life

                  This was the tutorial I used before to do before
                  Https://www.youtube.com/watch?v=19ARq_PzBnM

                  If I do not understand wrong, I think it's very likely that I've got it wrong.
                  But from what I've seen it picks up from the time you start to fall and you take damage when you land on the ground or transform the height you dropped and turn it into damage and then divided the value if the value is greater than your life you Die, if it is smaller than your life subtracts from it

                  I tried to mix to see if it works, but it did not work '-'

                  Click image for larger version

Name:	5Kh1EG5.jpg
Views:	1
Size:	409.9 KB
ID:	1126470

                  Click image for larger version

Name:	dAo38d7.jpg
Views:	1
Size:	171.5 KB
ID:	1126471
                  Attached Files
                  Last edited by GuilhermeAU; 04-14-2017, 11:35 PM. Reason: ImageEdit

                  Comment


                    #10
                    Currently moving no pc to look at this closer but what is your health float at for max health?

                    usually widgets display 0-1 for a progress bar. But if your damage isn't scaled to your health right or umg not showing health right could be a problem.

                    For instance if you use a float for health of zero to one you'd likely want to make sure your damage is applied in that range or you use 100 health for example and divide it by 100 in umg to get the 0-1
                    Inphidel / Brian - Developer of Ultraball
                    http://www.ultraballgame.com

                    Don't shy away from bugs in your game. Don't play it as intended. Break your game so you can fix it!

                    Comment


                      #11
                      To expand on this for damage depending on range decide max distance for death and minimum damage for say low damage and bra he it first for => death distance and if false you scale it so say 5000 units is hurt and 20000 is death use a scaler to make that between .01-.99 and multiple your Max allowed health to get the scaled damage float.
                      Inphidel / Brian - Developer of Ultraball
                      http://www.ultraballgame.com

                      Don't shy away from bugs in your game. Don't play it as intended. Break your game so you can fix it!

                      Comment


                        #12
                        Actually I'd do this sorry for rambling..

                        Branch on impact for should cause damage, take distance of that drop and go into the float map from that value to max distance of whatever you think is a lethal distance. On other end of the map input lowest damage and lethal damage. Then that return to how much damage is applied.
                        Inphidel / Brian - Developer of Ultraball
                        http://www.ultraballgame.com

                        Don't shy away from bugs in your game. Don't play it as intended. Break your game so you can fix it!

                        Comment


                          #13
                          I was able to correct this problem
                          I moved some sticks here and others
                          It's working now, not the way I wanted it to, but it's
                          But now I have another problem :v
                          Video of the problem I'm having right now
                          The beginning of the video was just to test if it was working

                          https://youtu.be/SrGO9wBq4z4

                          Comment


                            #14
                            Are you still changing health on both true and false?

                            when we measure the vector difference we are looking at a negative distance so we are looking for is my distance < distance like normal height is -400 difference and higher is technically less then that so -2000 < -400.

                            On land is distance < -800 true ok cause pain... Pain is distance -800 to -1500 mapping that alpha float .01 - 1... Damage = MaxDamage*alpha
                            Inphidel / Brian - Developer of Ultraball
                            http://www.ultraballgame.com

                            Don't shy away from bugs in your game. Don't play it as intended. Break your game so you can fix it!

                            Comment


                              #15
                              Yes, true is that in case the damage is greater than my life I die
                              And false is only to subtract the damage

                              Comment

                              Working...
                              X