[C++]How to use ParticleModuleEventSendToGame to broadcast collision event of Particles?

the following code is in \Engine\Source\Runtime\Engine\Classes\Particles\Event\ParticleModuleEventSendToGame.h, but I didn’t found any example about it, how to use this API?


// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.


#pragma once
#include "ParticleModuleEventSendToGame.generated.h"

UCLASS(abstract, editinlinenew, hidecategories=Object)
class UParticleModuleEventSendToGame : public UObject
{
	GENERATED_UCLASS_BODY()


	/** This is our function to allow subclasses to "do the event action" **/
	virtual void DoEvent( const FVector& InCollideDirection, const FVector& InHitLocation, const FVector& InHitNormal, const FName& InBoneName ) {}
};

The particle emitter in question has to have a collision module to detect collisions and then in blueprints you can pick up from the Collision event on that particle emitter and get the hit location of the collisions and perform functionality from there.

+1 is appreciated

You are right!! thx for your suggestion, I sorted it out :slight_smile:
BP

C++


UParticleSystemComponent* PSC = UGameplayStatics::SpawnEmitterAtLocation(MyGameMode->GetWorld(), SkillParticle_1004, Location, FRotator::ZeroRotator, true);

FScriptDelegate Delegate;
Delegate.BindUFunction(MyCharacter, "OnParticleHit");
PSC->OnParticleCollide.Add(Delegate);

Function Signature of Event callback:


UFUNCTION()
	void OnParticleHit(FName EventName, float EmitterTime, int32 ParticleTime, FVector Location, FVector Velocity, FVector Direction, FVector Normal, FName BoneName, UPhysicalMaterial* PhysMat);

No problem. I have quite extensive experience by now with the particle editor. Since I’m new around here I’d appreciate a +1 on my post. I’m trying to do my part for the community since I sometimes ask for help as well.