title: Creating Static Meshes in For Loop using C++ with unreal engine
body: <p><strong>this is the fix at top</strong>
  use this to create a string that Static Mesh Object can accept as a unique identifier so the engine doesn't crash</p>
  <pre><code>FName name = *FString::Printf(TEXT(&quot;Sphere %i&quot;), i);
  </code></pre>
  <p>I want to use a for Loop to create static meshes that I can reference later and link to other events over OSC.  I am having a problem figuring out how to name the instances using the CreateDefaultSubobject.</p>
  <p>I get this error when Compiling my code:</p>
  <pre><code>S:\UnrealEngine\CPP_LEARNING\ShaderShootEm_000\Source\ShaderShootEm_000\FlowSphere.cpp(19): error C4456: declaration of 'i' hides previous local declaration 
  S:\UnrealEngine\CPP_LEARNING\ShaderShootEm_000\Source\ShaderShootEm_000\FlowSphere.cpp(18): note: see declaration of 'i' 
  S:\UnrealEngine\CPP_LEARNING\ShaderShootEm_000\Source\ShaderShootEm_000\FlowSphere.cpp(23): error C4800: Implicit conversion from 'int32' to bool. Possible information loss 
  S:\UnrealEngine\CPP_LEARNING\ShaderShootEm_000\Source\ShaderShootEm_000\FlowSphere.cpp(23): note: consider using explicit cast or comparison to 0 to avoid this warning 
  C:\Program Files\Epic Games\UE_5.0\Engine\Source\Runtime\Core\Public\HAL\Platform.h(998): note: see declaration of 'int32'
  </code></pre>
  <p><strong>This is the Code</strong></p>
  <pre><code>RootComponent = CreateDefaultSubobject&lt;USceneComponent&gt;(&quot;SceneComponent&quot;);
  FVector CurrentLocation = GetActorLocation();
  StaticMeshes.Init(NULL,10);
  float distance = 0;
  int32 i = 0;
   for(int32 i= 0; i &lt; 5; i++)
   {
      FString Number = FString::FromInt(i);
      distance *= i * 100;
      StaticMeshes[i] = CreateDefaultSubobject&lt;UStaticMeshComponent&gt;(TEXT(&quot;Number %i&quot;),i );
      StaticMeshes[i]-&gt;SetRelativeLocation(CurrentLocation + FVector(0.0f, 0.0f, distance));
      StaticMeshes[i]-&gt;SetupAttachment(RootComponent);
   }
  </code></pre>
  <p>thanks for any help in advance~</p>