Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to implament locational damage for a tank?

I am trying to add locational damage for specific components of a tanks hull of turret these being static meshes, as tanks usually have most of thier armor concentrated on the front the sides and rear would be more vulnerable to damage (have a higher damage multiplier). The problem is that I would need to find a way to determine witch part of the mesh was hit and apply the according amount of damage.

Any suggestions?

Product Version: UE 4.22
more ▼

asked May 28 '19 at 03:43 PM in Blueprint Scripting

avatar image

1 1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

you can use on component begin overlap events, hit events only work on the root component. I think each component would need an event but you can use a function to reduce copy/ pasting the code.

I guess the code would be something like health - damage * multiplier.


if(damage - durability > 0) netDamage = damage - durability; return health - netDamage

more ▼

answered May 29 '19 at 02:30 AM

avatar image

1.4k 11 4 10

avatar image Mikhail-N May 29 '19 at 01:25 PM

Oh sorry my question was unclear, what I meant to say was to ask if there was a wayto determine weather the front side or rear of the same static mesh was hit.

Is there perhaps a way to add multiple collision zones to a single mesh or must I use multiple collision meshes?

avatar image IndieGameCove May 29 '19 at 05:23 PM

You could add collision components to the BP and use them as collision zones.

avatar image Mikhail-N May 29 '19 at 05:43 PM

I tried that but I could not find a way to create a custom collision component that resembled the shape of my tank is there any way to do this? Currently I am just using hidden meshes as collision components.

Furthermore I could not seem to get the overlap detection working for projectiles.

avatar image IndieGameCove May 29 '19 at 06:51 PM

I think you'd have to use hidden meshes for custom collision components.

another way to approach it is compare the hit location to the center of the tank. I think you'd have to transform the hit loc to local space.

avatar image Mikhail-N May 30 '19 at 06:18 PM

After implementing the aforementioned system based on overlap events I am now experiencing the issue of projectiles randomly ghosting through the armor meshes and hitting either the one behind or simply going straight through the tank without causing but a single hit point of damage.

I have also noted that these ghost shell events tend to occur more often at higher velocities however they are still present even at the velocity of a nerf blaster.

avatar image IndieGameCove May 30 '19 at 08:12 PM

There's a "use ccd" setting in the collision settings, which may help. if you're moving the projectile with set actor location or some equivalent you probably need to check the sweep checkbox.

avatar image Mikhail-N May 30 '19 at 09:50 PM

I have checked both. I also have tried tracing complex collision, most collision presets and many other things.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question