Component added at runtime doesnt have BeginPlay called on it.
Hello, So i created a Blueprint Function Library in C++, to allow me to add a component to an actor based on a passed in class, the only problem is, the component that is getting added to the actor is never having BeginPlay called on it.
Note: I am calling my AddComponentByClass custom BP function, in the Actor's BeginPlay event in the Actor's blueprint. Yet my Component's BeginPlay event, in its Blueprint, is never getting called.
From what i understand, all Default Components of an Actor have its BeginPlay called before the Actor's BeginPlay if im not mistaken, so how can i go about calling the newly added Component's BeginPlay event, when it may be added after the Actor has already been Initialized?
Here is an explanation for why this happens. I've marked my own comments with ---- so that they don't get confused with actual comments in the UE4 source:
If you're going to call BeginPlay() in your own code, make sure to first check that bHasBegunPlay on the component is false.
Follow this question
Once you sign in you will be able to subscribe for any updates here