# AddInstance() not adding the correct StaticMesh

**URL:** <https://forums.unrealengine.com/t/addinstance-not-adding-the-correct-staticmesh/387474>\
**Category:** Rendering\
**Tags:** staticmeshcomponent, unreal-engine, staticmesh, CPP, question\
**Created:** [March 10, 2017, 12:44am UTC](https://forums.unrealengine.com/t/addinstance-not-adding-the-correct-staticmesh/387474 "2017-03-10T00:44:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nthn911](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nthn911](https://forums.unrealengine.com/u/nthn911)\
**Post date:** [March 10, 2017, 12:44am UTC](https://forums.unrealengine.com/t/addinstance-not-adding-the-correct-staticmesh/387474/1 "2017-03-10T00:44:58Z")

</div>

Hi. This is my first project using C++ and I’m really having a lot of trouble with Instanced Static Mesh Components.

I have the following code:

```
Mesh = CreateDefaultSubobject<UStaticMesh>(TEXT("Mesh"));
static ConstructorHelpers::FObjectFinder <UStaticMesh>StaticMesh(TEXT("StaticMesh'/Game/Geometry/FloorSM.FloorSM'"));
Mesh = StaticMesh.Object;

ISMC = CreateDefaultSubobject<UInstancedStaticMeshComponent>(TEXT("Instanced Static Mesh Component ISCM"));
ISMC->SetStaticMesh(Mesh);

```

And the result:

 ![129361-game.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/1/2/312680ce02dfc250db9598a5f5f3ff0fe520006f.jpeg)

The Floor/walls are just the default cube. Am I missing something here?
