# Blueprint Implementable Custom Component Events?

**URL:** <https://forums.unrealengine.com/t/blueprint-implementable-custom-component-events/325751>\
**Category:** Blueprint\
**Tags:** custom-event, custom-component, unreal-engine, Blueprint, CPP, question\
**Created:** [July 18, 2015, 11:56pm UTC](https://forums.unrealengine.com/t/blueprint-implementable-custom-component-events/325751 "2015-07-18T23:56:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Slowmanrunning](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Slowmanrunning](https://forums.unrealengine.com/u/Slowmanrunning)\
**Post date:** [July 18, 2015, 11:56pm UTC](https://forums.unrealengine.com/t/blueprint-implementable-custom-component-events/325751/1 "2015-07-18T23:56:03Z")

</div>

I’m trying to create custom actor components which have implementable events. I have a basic unit class and a basic spell class, and I want to be able to create custom blueprints from those to make different types of units and different spells.

 ![50682-untitled.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/e/a/eeaf47a3c17e30066b953498ba1c1d591b93a44f.png)

I have a few events I want to be able to implement such as “OnCastBegin”, “OnCastSuccess”, and “OnCastFailure” etc. Here’s the full code for my ability’s header class:

```
#pragma once
#include "KBuff.h"
#include "KAbility.generated.h"
/**
 * 
 */

/*
	TODO:
	- Active Component: the action which happens if the ability is activated. An ability may or may not have an active.
	- Passive Component: the passive effects of the ability. An ability may or may not have passive effects.
*/
class AKBasePawn;

UCLASS(ClassGroup=(Ability), meta=(BlueprintSpawnableComponent))
class KIDSOFTHEWOODS_API UKAbility : public UActorComponent
{
	GENERATED_BODY()

public:
	UKAbility();
	~UKAbility();

	UFUNCTION(BlueprintImplementableEvent, Category = "KAbility")
	void OnCastBegin();
	
	UFUNCTION(BlueprintImplementableEvent, Category = "KAbility")
	void OnCastFail();
	
	UFUNCTION(BlueprintImplementableEvent, Category = "KAbility")
	void OnCastSuccess();
	
	UFUNCTION(BlueprintImplementableEvent, Category = "KAbility")
	void OnTargetHit(const AKBasePawn *Target);

	UFUNCTION(BluePrintCallable, Category = "KAbility")
	void ActivateAbility();

protected:
	AKBasePawn *owningUnit;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "KAbility")
	float castTime;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "KAbility")
	UKBuff *passiveAbility;

};

```

When I look at the static mesh reference of my blueprint, it has a ton of implementable events such as OnMouseOver, OnClicked, etc. I can’t figure out how to do that for my component.

---

<div class="post-metadata">

**Author:** ![Slowmanrunning](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Slowmanrunning](https://forums.unrealengine.com/u/Slowmanrunning)\
**Post date:** [July 19, 2015, 7:26am UTC](https://forums.unrealengine.com/t/blueprint-implementable-custom-component-events/325751/2 "2015-07-19T07:26:11Z")

</div>

I found that UPrimitiveComponent does the events I mentioned as follows:

```
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam( FComponentBeginCursorOverSignature, UPrimitiveComponent*, TouchedComponent );

//then further down...

UPROPERTY(BlueprintAssignable, Category="Input|Mouse Input")
FComponentBeginCursorOverSignature OnBeginCursorOver;
```

---

<div class="post-metadata">

**Author:** ![Slowmanrunning](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Slowmanrunning](https://forums.unrealengine.com/u/Slowmanrunning)\
**Post date:** [July 20, 2015, 8:44am UTC](https://forums.unrealengine.com/t/blueprint-implementable-custom-component-events/325751/3 "2015-07-20T08:44:35Z")

</div>

So I found out in order to have component events available to you in blueprints requires a dynamic multicast delegate–or at the very least a dynamic delegate, I haven’t tested whether that works as well.

 ![50769-untitled.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/1/c/d1c8998fe735c846ff8b8a349dc05c674a0319c1.png)

The code to do this is as follows:

```
#pragma once
//include headers
#include "UCustomComponent.generated.h"

DECLARE_DYNAMIC_MULTICAST_DELEGATE(FComponentCustomStartSignature);

UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
class MYGAME_API UCustomComponent : public UActorComponent
{
public:
    UPROPERTY(BlueprintAssignable, Category="Custom")
    FComponentCustomStartSignature OnCustomStart;

};

```

Do that, and your events should show up under events like in the bottom right corner of the picture.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d973a2dd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d973a2dd](https://forums.unrealengine.com/u/anonymous_user_d973a2dd)\
**Post date:** [December 11, 2015, 5:23pm UTC](https://forums.unrealengine.com/t/blueprint-implementable-custom-component-events/325751/4 "2015-12-11T17:23:36Z")

</div>

Is there a way to do the same via blueprint?  
I mean, a custom blueprint-made component.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c035ff34](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c035ff34](https://forums.unrealengine.com/u/anonymous_user_c035ff34)\
**Post date:** [August 3, 2018, 6:45pm UTC](https://forums.unrealengine.com/t/blueprint-implementable-custom-component-events/325751/5 "2018-08-03T18:45:19Z")

</div>

Add an Event Dispatcher and copy the Signature from the custom event you created.
