What is the proper way to Construct a pawn with ActorComponents?

I’m attempting to move some of the functionality from my Primary Pawn class into several ActorComponents, however I am not sure if the way I am attempting to construct the ActorComponents is correct.

When I create an ActorComponent (TestActorComponent) within the TestPawns constructor and attempt to register that ActorComponent in the constructor the program compiles fine, however when I try and register that ActorComponent in the constructor I get StaticFailDebug within UE4Editor-Core.dll, on the following line of the TestPawn constructor. (Example below)

At what point is the ActorComponent registration available to the pawn prior to game start? This is probably an easy question, but I haven’t traced the pawn function call stack far enough to figure it out just yet.

Ideally, the code I need to implement would occur after all of the components are registered (Pawn::PostRegisterAllComponents), however i’m not entirely sure where the proper location to register the components at the Pawn level is.

Mike C.

Header File

#include "TestActorComponent.h"
class ATestPawn : public APawn

	UTestActorComponent* TestActorComponent;

	virtual UTestActorComponent* CreateTestActorComponent();
	virtual void DestroyTestActorComponent();
	bool bTest;

CPP File

TestPawn::TestPawn(const class FPostConstructInitializeProperties& PCIP) : Super(PCIP)
	TestActorComponent = CreateTestActorComponent();
	if (TestActorComponent)
	bTest = false;

Try performing your component registrations in PostSpawnActor (override this function on your actor). Registering a component means registering it with the World, and your actor needs a world pointer already to do this. So component registrations can’t occur in the actor’s constructor.

Thanks Chris,
I knew it was something easy, but I didn;t know what UE3 pre/post BeginPlay calls turned into for UE4.