The root component of a Blueprint is determined by the order in which the components are defined in the constructor of a class (the component defined first becomes the root component). Trying to set a different component as the root component does not work.
public: UPROPERTY(VisibleAnywhere, BlueprintReadOnly) UStaticMeshComponent* TheMesh; UPROPERTY(VisibleAnywhere, BlueprintReadOnly) USphereComponent* TheSphere; AMyActor(const FObjectInitializer& ObjectInitializer);
AMyActor::AMyActor(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { TheSphere = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(this, TEXT("TheSphere")); TheMesh = ObjectInitializer.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("TheMesh")); RootComponent = TheMesh; }
RESULTS:
TheSphere component is still the root component.
EXPECTED:
TheMesh component is the root component.
I am not able to find world outliner how to enable it?
How can i modify the param name in EQS node
Undefined sysmbol: typeinfo for AActor when cross-compile linux dedicated server on windows
Lighting Turns Black in Play Mode
Hey, why do i get this when i snap two similar meshes together?
When I open UE4 4.24.3 it appears that. Does anyone know how to solve?
Head over to the existing Questions & Answers thread and let us know what's up.
0 |
Component | UE - Gameplay - Blueprint |
---|---|
Affects Versions | 4.6, 4.7 |
Target Fix | 4.7nux |
Created | Dec 16, 2014 |
---|---|
Resolved | Feb 3, 2015 |
Updated | Apr 27, 2018 |