Hi.
Is delegate binding in constructors standard practice? The reason I ask is that the first time I made use of delegates (binding to collision OnOverlap) I ran into a very awkward bug that was due to binding in the constructor. The issue, as far as I could work out, was as follows.
Delegate bindings are, it seems, serialized. I created a blueprint based off my class, therefore since the binding was done in the constructor (as opposed to, for example, BeginPlay) this was serialized with the blueprint’s CDO. I subsequently modified the binding in my c++ class, changing it to bind to a new method and deleting the initial method from the class entirely. My overlap event never fired, and stepping through the code I found that the delegate invocation list for spawned objects of my blueprint type still retained the original binding to the now-removed method. I recreated the blueprint and the issue disappeared.
So, I’m now thinking that if binding in constructors is intended usage, then there is perhaps a bug in the engine code dealing with serialized delegates, since it seems to me that changing delegate bindings is not an unreasonable thing to expect to be able to do.