sorry for the late reply. There were email notification issues.
To the topic:
I think that it would be more clean to have a corresponding UActorComponent::Foo method for each important AActor::Foo method being implemented and called at exactly the same time in code.
For AActor::BeginPlay there seems to be for example an UActorComponent::InitializeComponent.
The header says:
* Starts gameplay for this component.
* Requires component to be registered, and bWantsInitializeComponent to be TRUE.
So I would expect for example that every world-actor already exists during UActorComponent::InitializeComponent so that I am able to reference it.
Or I would like to spawn dependent actors in this method. Or like to initialize UMG Widgets.
Unfortunately I have always crashes If I am trying to do something of the above.
“Auto activate” is the same as setting “bWantsInitializeComponent” to be TRUE ?
If that is correct, I have afaik everything done to initialize the component correctly.
Some other notes:
I think UActorComponent::PostInitializeComponents would be more than nice to have, because there can be components which calculate properties from
properties which can reside in other components. Then the best place would be indeed UActorComponent::PostInitializeComponents.
As I do not want to always implement own actors or implement derived engine-components only for this functionality I wonder why they do not just exist in the component interface?
Is it because of performance reasons ? You could use something like UActorComponent::bWantPostInitializeComponents to avoid unnecessary calling.
It is because of some design guidelines ?
(E.g. forbid this functionality in order to force more intelligent derived actor implementations ? If this is the case, I think that it should be in the hand of the middleware user if he wants to use a flat list of combinable components defining an actor-type or deriving from an own actor-hierachy. I have used both and I think it stronly depends on the application/use-case)
I have now implemented and passed-through above methods for the components and have no problems at all
Thanks for your opinions/clarifications