For some reason when creating a static mesh component via c++ it won’t spawn in the correct location in game. My code is pretty basic so hopefully I’m just missing something obvious.
In my header file I have this:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
UStaticMeshComponent* HighlightMesh;
And in the cpp file:
HighlightMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("HighlightMesh"));
HighlightMesh->SetupAttachment(RootComponent);
Here is the view in the derived Blueprint.
And in the game view.
Whenever I duplicate the inherited mesh component I can actually get the blue square in the game view. Which leads me to believe that its just something funky with my code.
Any ideas?