Damage?

What would be the general way for damage to be dealt to a character if it comes in contact with a mesh such as a sword or something similar, thanks for the help in advance :slight_smile:

The how you manage collisions is the part that can be up for debate depending on what you intend to do.

I plan on having damage as soon as the weapon connects to an enemy character and im kinda new to all this so I don’t really know the correct way to put it :sweat_smile: but I’ll be using separate meshes for the weapons so maybe something like an on collision? But like I said before no idea really :sweat_smile: thanks for the help too :slight_smile:

Any game as reference?

Mount and blade

There’s an entire damage system with damage classes and all, waiting to leveraged:

  • in the Mount or Blade actor:

  • in the actor you’re Trampling or Slashing:

image

More Info:

Would a boolean work for an enemy check so there is some friendly fire i.e on collision get the actor and check if it was an enemy or ally then have a separate damage calculation like-50% or how would I go about that?

That’s what Damage Type Classes are for, also part of the system:

So yeah, you check whether what you hit isFriendly, and apply damage using a Friendly Fire class.

Thanks a bunch for all the help :slight_smile:

Something that you may want to keep in mind is to put two (or more) sockets on your weapon. One at the beginning of the blade and one at the end of the blade, using a sword or knife as an example. When you activate the weapon (re: swing it), you will have the sockets perform a line trace between them to register any hits. You can then use this to determine the object hit (re: enemy or ally or wall).

A collision shape sometimes does not register an actual hit if the event occurs too fast, but a line trace is instantaneous and registers.

A good example of this is here:

1 Like