[UE5, Networking] Should this go into the GameMode?

I think it has more to do with the fact that game mode is very specific. It doesn’t have a standard begin play from within c++ if my memory serves me well :stuck_out_tongue:

In game mode base

	/** Transitions to calls BeginPlay on actors. */
	UFUNCTION(BlueprintCallable, Category=Game)
	virtual void StartPlay();

There is no begin play and if you add it to your derived class it will most likely not fire.

You can try calling

AYourClass::AYourClass(const FObjectInitializer& ObjectInitializer)
	: Super(ObjectInitializer)
{
}

not sure if ObjectInitializer.DoNotCreateDefaultSubobject(TEXT("Sprite")) is needed in the super for derived, doubt it.

You could have your components implement an interface with a startup phase and just call that.

Edit: Though creating a new c++ actor component I got

// Sets default values for this component's properties
UMyActorComponentNew::UMyActorComponentNew()
{
	// Set this component to be initialized when the game starts, and to be ticked every frame.  You can turn these features
	// off to improve performance if you don't need them.
	PrimaryComponentTick.bCanEverTick = true;

	// ...
}

1 Like