I can't call my Events from my C++ component in Blueprints

I’m trying to create an actor component in C++ where it’ll have a function that is ‘BlueprintImplementableEvent’ making such a function an event. But when I attach the component to an actor and try searching for the event, it’s nowhere to be found.

here’s the code in the UInteractableObject.cpp
`
#pragma once

#include “CoreMinimal.h”
#include “Components/ActorComponent.h”
#include “InteractableObject.generated.h”

UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class OPERATIONSURVIVAL_API UInteractableObject : public UActorComponent
{
GENERATED_BODY()

public:
UInteractableObject();

protected:
virtual void BeginPlay() override;

public:
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;

// →→→→→→→→→→ Event I want to call in blueprints ←←←←←←←←←←
UFUNCTION(BlueprintImplementableEvent, Category = "Event on interact")
void StartInteraction();

};
`

And here is how my code looks in blueprints

Look at my below comment, anyone who wanders here:

1 Like

I’m new to UE and by no means an expert, but have you tried right clicking on the background and searching instead of dragging from an object?

Look at my below comment, anyone who wanders here:

it is impossible to do Event delegation from C++ to have impl on blueprint IF the class is a Component.

which you actually are using right now. I just have tried it, it only works if the class is an Actor. the name is also correct, so searching “Event” something something should come up.

in my case i was using

UFUNCTION(BlueprintImplementableEvent, Category = "Custom")
void ShakeCameraFastDelegate();

inside class RTS_API UCameraManagerComponent : public UActorComponent. This did not work.

///////////////
UCLASS()
class RTS_API AMyCameraActor : public ACameraActor
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintImplementableEvent, Category = “Custom”)
void ShakeCameraFastDelegate();
};

but this worked

To properly answer the question, BlueprintImplementableEvent does not imply BlueprintCallable. You can have a function implemented in blueprints, but not callable by the blueprints- even from within the function you’re implementing.
So the correct UFUNCTION would be this:

UFUNCTION(BlueprintCallable, BlueprintImplementableEvent, Category = "Custom")
void ShakeCameraFastDelegate();

Or in Mata’s case, this:

UFUNCTION(BlueprintCallable, BlueprintImplementableEvent, Category = "Event on interact")
void StartInteraction();

The order of UFUNCTION tags don’t matter, so you can flip them if you’d like:

UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "Event on interact")
void StartInteraction();

This is the case for all types of components and actors, including ACameraActor.

This is not true, you can absolutely do Implementable or Native events on components and have them work just fine.

The problem you are seeing is that you if you declare a blueprint event on a component and add that component to an actor the event won’t be available for the actor’s event graph. However, if you create a blueprint of the component, the event will be available on that event graph.

1 Like

BlueprintCallable is what you need, also no need to type “event” just the event or function name and it should come up at the top or bottom of search, also for interaction have you considered just setting up an interface?

Interesting… thank you for clarifying