During recent work on creating custom derived classes from PlayerController and Character, I ran into some nullpointer problems. Can anyone explain in clear manner, or point to clarifying documentation or other resource, that explains what is the sequence of events (a diagram/simple schematic would help) when we create a new controller and a new pawn/character. Who gets instantiated first, when possession takes place etc. As I just explained, several times when creating subobjects or trying to access each class so that the two objects can communicate with each other, I ran into exceptions, where the pawn/character reference wasn’t there yet and ready to be read etc.
A common pattern I’ve seen is to make classes in C++ with UPROPERTY’s, then make a blueprint from the C++ class to allow those properties to be configured in the editor. E.g. the DestinationMarker (see cpp file above) can be set to a static mesh and saved in a blueprint in the editor.
Abdul’s suggestion to UE_LOG in the constructors is a good one.
For sure, I know I can do that, and probably what will end up doing to fully understand, but I was wondering whether there was some official resource anywhere to read and understand how the engine’s logic works about these things. Anyway, many thanks for taking the time to respond!