Setting up UMotionControllerComponent from C++ causes game to hang

Build type: binary

Build version: 4.19.0-3861363+++UE4+Release-4.19

MyPawn.h

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "MyPawn.generated.h"
...
class UMotionControllerComponent;
...
UCLASS()
class MYGAME_API AMyPawn : public APawn
{
	GENERATED_BODY()
...
public:
    UPROPERTY(EditDefaultsOnly, Category = "MyPawn")
		UMotionControllerComponent* MC_Left;

	UPROPERTY(EditDefaultsOnly, Category = "MyPawn")
		UMotionControllerComponent* MC_Right;
...
}

MyPawn.cpp

#include "MyPawn.h"
#include "MotionControllerComponent.h"

AMyPawn::AMyPawn()
{
...
    MC_Left = CreateDefaultSubobject<UMotionControllerComponent>(TEXT("MC_Left"));
	MC_Left->MotionSource = FName(TEXT("Left"));
	MC_Left->SetupAttachment(RootComponent);

	MC_Right = CreateDefaultSubobject<UMotionControllerComponent>(TEXT("MC_Right"));
	MC_Right->MotionSource = FName(TEXT("Right"));
	MC_Right->SetupAttachment(RootComponent);
}

Actions:

  • Create BP based on that pawn
  • Create GameMode with BP Pawn as default
  • Launch PIE
  • Wait for 1 min
  • Enjoy garbage collector hanging your game

Also, issue does not appear, if I turn on bDisableLowLatencyFlag

Looks correct and it’s basically how we have our controllers setup in 4.18. The only thing I do see is that the RootComponent isn’t actually created, maybe create that component too:

RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("Root Component"));

I skipped that part in question (implying that it’s created in “…” part).

DefaultSceneRoot = CreateDefaultSubobject<USceneComponent>(TEXT("DefaultSceneRoot"));
RootComponent = DefaultSceneRoot;

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

https://forums.unrealengine.com/unreal-engine/announcements-and-releases/1410408-unreal-engine-bug-submission-form

Thanks