From 62ac0e74964430e9988858d38b45e9712781bcef Mon Sep 17 00:00:00 2001 From: baz Date: Tue, 12 Sep 2023 23:37:49 +0100 Subject: [PATCH] Set Root Component in Pickup --- Source/Nakatomi/Pickup.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Nakatomi/Pickup.cpp b/Source/Nakatomi/Pickup.cpp index 80b425d..e4227f0 100644 --- a/Source/Nakatomi/Pickup.cpp +++ b/Source/Nakatomi/Pickup.cpp @@ -18,8 +18,7 @@ APickup::APickup() SphereComponent = CreateDefaultSubobject(TEXT("SphereComponent")); SphereComponent->SetSphereRadius(25.0f, true); SphereComponent->SetCollisionEnabled(ECollisionEnabled::QueryAndProbe); - - SphereComponent->SetupAttachment(RootComponent); + SetRootComponent(SphereComponent); PointLightComponent = CreateDefaultSubobject(TEXT("PointLightComponent")); PointLightComponent->SetupAttachment(RootComponent);