This works fine when I add events within the actors the blueprint is a child of, but turns out it does not appear the same way when it’s a part of an added component instead.
Thanks but I’m afraid not, I’ve done it this way before when implementing events in actors directly without issues.
But now that it’s a part of a component that’s added in blueprint instead, it doesn’t seem to show up.
It doesn’t show up in the list of events under the component’s details tab either.
The component is pretty much just a child of BoxComponent with my custom event, if that helps.
If I make the component blueprintable and make a new blueprint based on it, the event appears, however that defeats the purpose of having it as an optional component to attach to other blueprints.
So it’s definitely related to it being a component and not the base class of the blueprint.
#pragma once
#include "CoreMinimal.h"
//#include "Components/SceneComponent.h"
#include "Components/BoxComponent.h"
#include "InteractionComponent.generated.h"
UCLASS(Blueprintable, ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
class TRIBESMEN_API UInteractionComponent : public UBoxComponent
{
GENERATED_BODY()
public:
// Sets default values for this component's properties
UInteractionComponent(const FObjectInitializer& ObjectInitializer);
protected:
// Called when the game starts
virtual void BeginPlay() override;
public:
// Called every frame
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
//UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Collision)
// UBoxComponent* CollisionComp;
UFUNCTION(BlueprintImplementableEvent, Category = "Interaction")
void TriggerInteraction();
};
Edit: I was finally able to work around it, but it seems rather excessive and “hacky”.
Instead of using a blueprintable event, I made a delegate that I broadcast, and bound the delegate (which luckily showed up) to a custom event.
But it feels inefficient to make a function that constantly listens for a broadcast, instead of just having it trigger on use.