I created a custom enemy blueprint character for the shooter game that will chase me around.
It chases me.
It is derived from ShooterCharacter.H
Now I want to damage and kill him with the Machine gun.
I was looking at this Shooter Game | Unreal Engine Documentation
Which led me to the ProcessInstantHit_Confirmed Method in ShooterWeapon_Instant.cpp
So I took a look at what was there
void AShooterWeapon_Instant::ProcessInstantHit_Confirmed(const FHitResult& Impact, const FVector& Origin, const FVector& ShootDir, int32 RandomSeed, float ReticleSpread)
{
// handle damage
if (ShouldDealDamage(Impact.GetActor()))
{
DealDamage(Impact, ShootDir);
}
// play FX on remote clients
if (Role == ROLE_Authority)
{
HitNotify.Origin = Origin;
HitNotify.RandomSeed = RandomSeed;
HitNotify.ReticleSpread = ReticleSpread;
}
// play FX locally
if (GetNetMode() != NM_DedicatedServer)
{
const FVector EndTrace = Origin + ShootDir * InstantConfig.WeaponRange;
const FVector EndPoint = Impact.GetActor() ? Impact.ImpactPoint : EndTrace;
SpawnTrailEffect(EndPoint);
SpawnImpactEffects(Impact);
}
}
From reading that it looks like I should be able to make something happen on a character derived from shootercharacter.h when an instant hit occurs
using the blueprint node “any damage”. I tried to a few classes from the shooter game on AnyDamage like this.
I couldn’t get them to work.
Does anyone know if there is a way I can detect instant hit events from the shooter game and then make something
happen in BP?