Hey guys,
I have a class, that is inherited from AActor.
In this class, I added a StaticMeshComponent and a SceneComponent.
The SceneComponent should allow a class instance to be moved, right?
The StaticMesh, however, always stays at the same position, no matter where I move the SceneComponent.
Here is my code in the header file:
UPROPERTY(VisibleAnywhere, Category = "Dungeon")
TSubobjectPtr<UStaticMeshComponent> roomMesh;
UPROPERTY(VisibleAnywhere, Category = "Dungeon")
TSubobjectPtr<USceneComponent> sceneComp;
and here is, what I did in the constructor in order to be able to move the Mesh (at least I thought that):
sceneComp = PCIP.CreateDefaultSubobject<USceneComponent>(this, TEXT("scene"));
RootComponent = sceneComp;
roomMesh = PCIP.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("mesh"));
roomMesh->AttachTo(sceneComp);
I am sure this is just a very simple problem, but I can’t find the correct answer.
Thanks in advance