I’ve had to create a super class for a blueprint I was working on as I needed to cast in C++ and couldn’t with a BP only class. Let’s call the Cpp & BP file MyClass and BP_MyClass.
As part of the old BP_MyClass, which was a regular Blueprint Class, I had a custom event void EventA(..)
I could cast to BP_MyClass in another blueprint file and then call EventA(...) on the casted output.
However, now that I’ve moved my event definition into cpp - MyClass,
I can implement the event in the new BP_MyClass, which now derives from MyClass, fine.
However, when I cast to BP_MyClass in another blueprint file, I cannot call EventA(...).
It’s as if when I derive BP_MyClass from MyClass, the public EventA(...) is turned private, hiding it from other BPs.
It doesn’t show up in the right click menu with context sensitivity turned off either. Anyone know what I’m doing wrong?
Edit:
If I create a “new Custom Event” in BP_MyClass, I still can’t see that new one in another BP after casting. I’ve saved + compiled the bp and recompiled from vs to no success.
Edit: I removed Blueprintable and I can’t see any difference - it still compiles fine. So I’m unsure why I had that in the first place. Although, I still can’t call the event so that wasn’t the issue
After some tinkering, I was able to use event dispatchers to get my desired effect. I’d imagine it’s not as versatile as if I had actually gotten the C++ events to work, but this suffices for my particular use case.
For future people who might need a workaround like me:
Create an event dispatcher, name as you like
Drag it onto the BP editor and select “Event” to create your custom event node
I’m unsure why this event worked, but I already had an “Init” event that showed up fine in other classes.
This meant I could tack onto the end of that execution thread a “Bind” to my event dispatcher,
Just link the In delegate param to the event you’ve just made for the dispatcher.
In my other BP I can now call the event dispatcher