Previously when working with C++ and binding functions to events, I would’ve done the binding in the classes Ctor.
(for context, I’m referring to binding a classes function to an event of on of its components, such as CapsuleComponent
s OnComponentBeginOverlap
and such)
I’ve learned the hard way that those kind of bindings shouldn’t be done in the Ctor, due to the CDO and undesired behavior due to the order of initializations and such.
I’ve then moved to do so in BeginPlay, just like it’s common in Blueprints.
I’m wondering if there is a better practice, or a more appropriate place to do the binding than BeginPlay
? Such as PostInitializeComponents
?