For
RootComponent = MeshInstances;
I get…
E0513 a value of type “UInstancedStaticMeshComponent *” cannot be assigned to an entity of type “USceneComponent *”
and
C2440 ‘=’: cannot convert from ‘UInstancedStaticMeshComponent *’ to ‘USceneComponent *’
and for…
MeshInstances->AddInstance(InstanceTransform);
I get…
E0393 pointer to incomplete class type is not allowed
and
C2027 use of undefined type ‘UInstancedStaticMeshComponent’
Essentially it can’t assign because it can’t resolve UStaticMeshComponent type.
Adding…
#include “Components/StaticMeshComponent.h”
Solved the issue for me.