Hello,
when scripting in a blueprint that derives from UObject but not from AActor certain functions cannot be seen in the “All actions for this blueprint” search bar with “Context Sensitive” disabled.
Reproducing the bug:
- Add C++ Class inheriting directly from UObject
- Add the following class specifiers: BlueprintType, Blueprintable
- Add a method with a pointer to an actor as parameter.
- Add the following function specifiers: BlueprintNativeEvent, Category
- Create Blueprint deriving from C++ class and implement the native event
- Right-click and experience missing functions, such as: Add Child Actor Component. Even using the actor parameter which could be used as “Target” does not show up.
Edited 11/05 at request of Sean Flint :
First off, I would like to thank you for looking into this issue more deeply.
The below code snippet is the class I wish to use as a parent in a blueprint; please assume that Callback_Implementation, which is required for native events, is defined and is empty.
UCLASS(Blueprintable, BlueprintType, EditNewInline)
class SOME_API UCallable : public UObject
{
GENERATED_BODY()
UFUNCTION(BlueprintNativeEvent, Category = SomeCategory)
void Callback(AActor* Actor);
};
I am aware the particular function which was mentoined in step 6, “Add Child Actor Component”, is not a function contained in UObject; it is contained in AActor I presume. However, it should be possible to call “Add Child Actor Component” by using the actor as a target to call on. For instance, in C++ you could still call Actor->AddChildActorComponent(args) in the implementation of Callback even though AddChildActorComponent is not defined in UObject (assuming it is indeed a member function of AActor). Elaborating on Sean’s point more, the component would then be stored as a child of the “Actor” parameter on which we called the function.
The bug I am experiencing is that the function “Add Child Actor Component” and many other functions do not show up in the search bar of the blueprint. I expect functions which were not defined in UObject but in other classes, such as AActor, which have a target, to show up and be able to call them; in blueprints I expect to be able to do the equivalent of: Actor->AddChildActorComponent(args). This assumes that “AddChildActorComponent” is indeed a member function of AActor but I just use it to better explain my pointer; member functions, hence those that have an implicit ‘this’ pointer, should be callable in that setting.
I have further experimented with the bug and discovered that if UCallable inherited from UActorComponent instead, all functions would show up in the search bar. This is bizarre as UActorComponent directly inherits from UObject, as well, which leads me to believe this is some kind of bug.
Thank you for your time and efforts.
Cheers,
Univise