Announcement

Collapse
No announcement yet.

How does one add weakspots to a vehicle?

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

    How does one add weakspots to a vehicle?

    I cannot figure out how to nor find any guides on the internet on how to add weakspots to an armored vehicle like in world of tanks or armored warfare, does anyone know how I might achieve this?

    #2
    Hi man ,

    if you have a weapon that hit your vehicle, and do an action like explode or just damage the vehicle, add to that event some steps.
    Use a raycast to check the exact point where you hit the vehicle, if you want you can check the exact mesh, if your mesh is bigger and you just nneed a weakspot in the middle, save the position of the Bullet/Ray/bomb, at the moment of the add damage .
    In the vehiccle add a scene component, and place it where you want the weakpoint.
    Be careful that if the mesh part moves, your scenecomponent have to be his child, to be moved with him and follow.
    In case of skeletal mesh, you should instead create something to bind to the skeletal bones, because skkeletal meshes dont move/rotate ceasily.
    Then Check the distance you want bertween World position of the Weapon exploding/hitting - Worldposition of scenecomponent you added.
    Doing a Vector vector and using a get lenght of the vector you can check if
    if is < 50 for example you hit that spot, otherwise no

    Comment


      #3
      Sorry I am having a little bit of trouble understanding what are you mean. Are suggesting that I use a hidden scene component as a collision mesh or some way of determining the location of the impact?

      I am using mostly hitscan weapons like railguns, particle cannon, ect as anti tank weapons. It would probably be very inconsistent if I attempted to make it work for radial damage so I am thinking of just having explosions do a constant but low amount of damage to heavily armored vehicles.

      Comment


        #4
        Would anyone know what method of location based damage is used for the tanks is Squad? Something like that could work, not quite War Thunder but adequate.

        Comment


          #5
          Just use seperate hitboxes or some basic blueprint to change dmg on hit location.

          Comment


            #6
            Originally posted by Bits360 View Post
            Just use seperate hitboxes or some basic blueprint to change dmg on hit location.
            My problem is that I cannot find a way to import custom collision and even if I did I would still need to know how to add multiple collision meshes to a single object and then determine which one was hit.

            As for this suggestion of using blueprints to determine whether the location of the impact is light, medium or heavy armor, would that work for a very complicated armor scheme (weakspots such as the lower plate, turret ring, drivers hatch, ect) or is it just for determining which side of the vehicle was hit?

            Comment


              #7
              Originally posted by Mikhail-N View Post

              My problem is that I cannot find a way to import custom collision and even if I did I would still need to know how to add multiple collision meshes to a single object and then determine which one was hit.

              As for this suggestion of using blueprints to determine whether the location of the impact is light, medium or heavy armor, would that work for a very complicated armor scheme (weakspots such as the lower plate, turret ring, drivers hatch, ect) or is it just for determining which side of the vehicle was hit?
              You can add multiple collision boxes manually in ue4, and blueprint is mostly just for determining what side, however, now that i think of it, you could use box collisions on your blueprints with a custom trace channel/object channel to only respond to bullets, which would also be on another trace/object channel, and depending on which box is hit, do damage based on that

              Comment


                #8
                Originally posted by Bits360 View Post
                now that i think of it, you could use box collisions on your blueprints with a custom trace channel/object channel to only respond to bullets, which would also be on another trace/object channel, and depending on which box is hit, do damage based on that
                That would be ideal for my project, are there any guides on how to do this? I could not find any, I am somewhat new to game development.

                I looked through a lot of options and could not find any "collision mesh" or "hitbox" options in the blueprint editor.

                Comment


                  #9
                  Use Event Point Damage, instead of Event Any Damage, and Apply Point Damage, instead of Apply Damage. With that you can get the hit result, break it, get the hit bone name, location, etc.
                  FPS Game Starter Kit
                  Retro Game Starter Kit
                  Quiz Game Starter Kit
                  Twin Stick Game Starter Kit

                  Comment


                    #10
                    Originally posted by SB1985 View Post
                    Use Event Point Damage, instead of Event Any Damage, and Apply Point Damage, instead of Apply Damage. With that you can get the hit result, break it, get the hit bone name, location, etc.
                    I am already using apply point damage and recieve point damage and have implemented a bone based locational damage system for humaniod NPCs, my problem is that I want to add location based damage for tanks which use static meshes, I could just make the tank a skeletal mesh and assign weakspots to bones if I get desperate, but I would rater try and find a cleaner and less horrific way of achieving a location based damage system for vehicles

                    Comment


                      #11
                      Physics Materials

                      and make the damage based on the physical material

                      you have to go to the project settings and create physical surfaces.

                      Create physicalMaterials for each section. right click > /physics/physicalmaterial

                      You have to apply a physical surface to the tank mesh physics asset file per bone physics.

                      create a function that handles the damage setting based on the physical material hit in the tank

                      change the damage threshold scale in teh physical material properties/details and set a physical surface type.

                      create a take damage event that triggers the set damage function.

                      It all runs off the damage threshold scale set in the physical material details. This threshold is also based on the damage output of the projectile/linetrace. 1 = full damage .1 = 10% damage. I haven't tried bigger numbers like 2 or 3 but i'm guessing you can make that sectionn "weaker" by upping the damage threshold to 2 or more for double damage taking.
                      Attached Files
                      Last edited by MindfieldsTech; 07-21-2020, 11:07 PM.

                      Comment


                        #12
                        Originally posted by MindfieldsTech View Post
                        Physics Materials

                        and make the damage based on the physical material

                        you have to go to the project settings and create physical surfaces.

                        Create physicalMaterials for each section. right click > /physics/physicalmaterial

                        You have to apply a physical surface to the tank mesh physics asset file per bone physics.
                        The tank is made up of static meshes (the weakspots are supposed to be sections of these) and I need to be able to precisely control where the weakspot are, so randomly generated collision is not an option.

                        If you have ever played Warthunder, World of tanks or Armored warfare, that is what I want to try and replicate. I believe there is also a similar system is Squad.

                        Comment


                          #13
                          Originally posted by Mikhail-N View Post

                          The tank is made up of static meshes (the weakspots are supposed to be sections of these) and I need to be able to precisely control where the weakspot are, so randomly generated collision is not an option.

                          If you have ever played Warthunder, World of tanks or Armored warfare, that is what I want to try and replicate. I believe there is also a similar system is Squad.
                          you can take what i mentioned and apply it to each static mesh. i never mentioned a randomly generated collision. if anything the option i provided is as direct control over the damage as possible... but your choice how you want to implement it. good luck!

                          Comment


                            #14
                            Originally posted by MindfieldsTech View Post

                            you can take what i mentioned and apply it to each static mesh. i never mentioned a randomly generated collision. if anything the option i provided is as direct control over the damage as possible... but your choice how you want to implement it. good luck!

                            Oh sorry I did not make it clear enough, I want to add multiple weakspots to a single static mesh.

                            I use separate meshes for separate components; hull, turret ,tracks, ect, it would be a real mess if I were to have to try and split each one into multiple in order to add weakspots.

                            Comment


                              #15
                              Originally posted by Mikhail-N View Post


                              Oh sorry I did not make it clear enough, I want to add multiple weakspots to a single static mesh.

                              I use separate meshes for separate components; hull, turret ,tracks, ect, it would be a real mess if I were to have to try and split each one into multiple in order to add weakspots.
                              Hmmmm Your best bet then is to convert those static meshes to skeletal meshes, then that opens your world up to adding the individual collisions to each mesh in the physics properties the way I showed you.

                              so instead of having the tank built up from static meshes, your process will be the same but instead the pieces will be skeletal meshes.

                              Comment

                              Working...
                              X