Skip to content

1. Starting with the Gore System

Klian edited this page Mar 24, 2024 · 18 revisions

Locate your Character class

Locate the Blueprint class you want to use with this plugin, any Actor is supported (not just Character class) as long as it owns a skeletal mesh component which will be the target mesh for the system.

In my case, I'm gonna use a fresh new Character class:

image

Add the GoreSystemComponent

Add the "GoreSystemComponent" like any other ActorComponent!

image

[Optional] Initialize "GoreSystemComponent"

The component will automatically look for a "SkeletalMeshComponent" inside his owning actor but you can manually set which Skeletal Mesh should be affected by the system using the function "Init"

image

Fill the data structure

image

UEGoreSystemHit

This struct contains 3 fundamental parameters needed for the system to work properly. The data you decide to feed into the system is up to you. Most of the time a Trace or Physical Hit Event is the most preferible way to gather those data.

image

  • BoneName = Name of the bone you're damaging
  • Location = The exact spot your damage landed
  • Normal = Normal of the surface you hit

Apply Gore Damage Function

This is the main fuction you should use to handle damage to your character.

image

Each bone has its set of variables you can customize, like HealthMap, DamageMultiplierMap and IgnoreIsDead. Those informations will be taken in account by the system when you use this function.

Inputs

  • In_Damage = Base damage you want to apply
  • In_IsDead = Notify the system if this character is dead (easy to integrate with your game's damage system)
  • In_DetachmentForce = Impulse force the system will apply to the limb when detached. The direction of this impulse depends on the normal given
  • In_BoneHit = Data structure containing base informations about the damage location

Outputs

  • NewBoneHealth = Health after the specified bone received damage. It's [CurrentBoneHealth - (DamageIn * DamageMultip)]
  • DamageApplied = The total damage applied to your bone. It's [DamageIn * DamageMultip]
  • ReturnValue = It will return false if the bone you're trying to destroy is not on contained in BodyMap

DestroyBones

This function will batch-destroy a list of bones, ignoring any variable related to health status of those bones. The function will return false if no bone can be destroyed.

image

It's pretty much a simplified version of Apply Gore Damage for multiple bones. You can also use its variant for a single bone

image

OnBoneBroken

This is a simple event dispatcher that will fire every time a new bone is broken, returning its name

image