It seems that an
ActorComponent cannot call
There is an assert that checks for a
bHasBegunPlay that is set to true when the
Super::BeginPlay is called, but if the
DestroyComponent() is called then that flag gets set to false. Welcome to an assert.
Basically the functionality I’m looking for is that by default, any Actor can slap my
CustomActorComponent on them, particularly by default for designers. But I want to be able to automatically detach the component if it doesn’t meet certain criteria or under specific conditions. For ease of use, my use case was that designer should not have to manually evaluate if this component can be attached in my scenario or inversely, manually removed.
However, if you cannot call
BeginPlay or even anything prior to it being called, I don’t see an alternative There is no such thing as a
PostBeginPlay or any hooks I can tap into, and I do not want to wait for it to tick.