If an existing AddComponent node is placed in an Actor Blueprint's Event Graph for a custom ActorComponent-based Blueprint Class, the node will fail to be scheduled after adding a variable marked "Expose on Spawn" to the ActorComponent-based Blueprint Class.
Also, in //UE4/Main (4.11), the AddComponent node will produce an error after the variable is added (Invalid class 'REINST_PayloadComponent_C_206' used as template by 'Add REINST Payload Component C 206'...) It's removed after explicitly recompiling the Blueprint Class. The error does not occur in 4.9/4.10.
WORKAROUND:
Remove the Expose on Spawn variable from the ActorComponent-based Blueprint Class, then delete and re-add the AddComponent node in the Actor Blueprint's Event Graph.
1. Launch QAGame editor.
2. Create 2 new Actor-based Blueprint Class assets, and 1 new ActorComponent-based Blueprint Class (named Bullet, Gun and PayloadComponent respectively).
3. Open the "PayloadComponent" in the Blueprint editor and add a PrintString node linked to the BeginPlay event in the Event Graph. Compile and save.
4. Open the "Gun" Blueprint Class in the Blueprint editor and add a "Spawn Actor from Class" node linked to the BeginPlay event in the Event Graph. Change the 'Class' input to 'Bullet' and link a MakeTransform node to the Spawn Transform input.
5. Right-click and type 'AddPayloadComponent' and choose the "Add PayloadComponent" item to add the node. Link it to the SpawnActorFromClass node and link the 'Return Value' output pin to the 'Target Actor' input pin on the AddComponent node. Compile and save.
6. Drag the 'Gun' Blueprint Class into the level to add an instance.
7. Start PIE. Note that "Hello" is printed out.
8. Quit PIE and re-open the PayloadComponent Blueprint Class in the Blueprint editor.
9. Add a new variable of type 'Actor' (reference), and make sure it's marked "Editable" and "Expose on Spawn." Compile and save.
10. Open the Gun Blueprint Class in the Blueprint editor once more and notice that the AddComponent node does not show the variable that was added in the previous step. (Also note that in 4.11/main the node is now displaying an error.)
11. Right-click on the AddComponent node and choose "Refresh Nodes." Note that the variable is now shown as an input pin.
12. Compile and save, close the Blueprint editor and launch PIE again.
RESULT:
No message is printed out as expected.
FREQUENCY:
100%
I am not able to find world outliner how to enable it?
Undefined sysmbol: typeinfo for AActor when cross-compile linux dedicated server on windows
Delay nodes occasionally don't fire the "Completed" output in a nativized build
What method is used to fill polygonal regions when drawing spline mesh at run time?
When I open UE4 4.24.3 it appears that. Does anyone know how to solve?
How does TextureRenderTarget2D get TArray<uint8> type data?
How does UMG set overlapping layouts?
How to achieve HLSL Multiple Render Target in Material blueprints?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-23340 in the post.
2 |
Component | UE - Gameplay - Blueprint |
---|---|
Affects Versions | 4.9, 4.10 |
Target Fix | 4.11 |
Created | Nov 13, 2015 |
---|---|
Resolved | Jan 14, 2016 |
Updated | Apr 27, 2018 |