First of all, as with all my recent Feature Requests, I would like to say “thank you” to Epic Games and the Unreal Engine team for providing me and others with such a great tool, as well as its source. I hope my feedback can help improve it.
There are several very inconvenient limitations to the availability of Blueprint nodes, that have no reason not to be available. For example:
- It is impossible to call nodes that require a world context, like “Spawn Actor from Class” or “Create Widget” from blueprints of UObject type.
- It is impossible to call nodes that Add Component of some class (such as Add Static Mesh Component) from blueprints that aren’t AActor type.
For the first example, “Spawn Actor from Class” doesn’t have a “target” input, it implicitly calls the spawn on the World of whatever is executing the node akin to [FONT=Courier New]Self->GetWorld()->SpawnActor(…), instead of [FONT=Courier New]target->GetWorld()->SpawnActor(…). If there is a valid reference to something with a World Context, like an AActor, in the UObject, it should be possible for the UObject to request the AActor to execute the spawn. Same goes for CreateWidget node. And it is indeeed possible with an inconvenient workaround:
The only workaround I found, is to create a wrapper function in some custom class that has a world context.
In the example image below, an AActor BP called SomeActor has a function called “Spawn Some Other Actor Wrapper”. The input of the wrapper function is connected to a “Spawn Actor from Class”, output returns a referece to the spawned actor. A UObject BP called SomeObject calls this, sucessfully spawning an actor and getting the reference to it.
Of course, that’s very inconvenient and not flexible at all, as you have to manually create a wrapper function in SomeActor for any Actor class that you want to spawn, and then UObject BPs can only spawn actors if they have a reference to something inheriting from SomeActor.
See here - image 1 is no spawn node available in SomeObject class. Image 2 is wrapper function in SomeActor class. Image 3 is we get the result we need, in a very inconvenient way.
](filedata/fetch?id=1816803&d=1601389484)**The second example **is the issue with the “Add ___ Component” nodes. There, the target pin exists, but for some reason, the node itself doens’t appear outisde of AActor node graphs. Of course, it makes sense that only actors should be able to create components on themselves, as the [FONT=Courier New]CreateDefaultSubobject C++ function for components can only be called by AActor.
What doesn’t make sense though, is that these nodes *only *appear in Actor BPs. So, any Actor can make any other Actor create a component on itself, but nothing else can - not ActorComponents, not Objects, not UserWidgets etc.
It feels like these nodes should appear from anything that has a reference to any Actor - just drag it out from the reference, that’s it.
See here: Image 1 is SomeActor asking SomeOtherActor to add a static mesh component - ALL GOOD, the node shows up, and any actor can be connected to the Target node. Image 2 is SomeComponent asking SomeOtherActor to do the same - NOTHING. Why not? There is a valid actor reference, and the node has a “target” input, as seen in image 1, but because this is a ActorComponent BP, the node can’t be placed.
Like the first example, it’s again possible to create boiler plate wrapper functions in some custom Actor class, which only call the “add component” node and return the reference. And again, it’s very inconvenient for the same reasons.
(I won’t make example images for the boiler plate “add component” functions, I assume the reader gets the point by now).
**Would Unreal developers please consider making this possible, as it makes perfect logical sense, and is indeed possible to do equivalent operations already, either ****in C++ or with weird loopholes like wrapper functions.
There are a lot of BP or partly-BP projects that need this flexibility.**