title: Unity Script only works with long namespace name
body: <p>I tried following this <a href="https://youtu.be/Pa6Uf2jLUQg" rel="nofollow noreferrer">Unity ECS Entity Manager Tutorial from Turbo Makes Games</a>.
  I'm using Unity 2020.3.20f1.1086.</p>
  <p>The Code works initially but I noticed, that Line 20 in SpawnEntitiesSystem.cs <code>EntityManager.SetComponentData(newEntity, newPosition);</code> stops working when I change or remove the namespace. After tinkering a bit with the code I can reproduce that the specific namespace is not important but the namespace has to be at least 18 characters long for the code to work as expected. If I change the namespace to 17 characters all entities are spawned at the same place. Other code after the faulty line 20 was executed but for readability I removed it from the code example. (Originally user input was also handled and in OnStartRunning a component was added to the new entitiy)</p>
  <p>I only heard of similar problems in e.g. C++ when using pointer maths but I thought something like this shouldn't happen in C#. Does anyone have an idea what the core problem could be?</p>
  <p><strong>What I already tried without succes</strong></p>
  <ul>
  <li>restart Unity</li>
  <li>delete Library, Obj and Logs folders</li>
  <li>write code from scratch in new project</li>
  <li>restart PC</li>
  </ul>
  <p><strong>SpawnEntitiesSystem.cs</strong></p>
  <pre class="lang-cs prettyprint-override"><code>using Unity.Entities;
  using Unity.Mathematics;
  using Unity.Transforms;
  
  namespace ALongNamespaceABCD { 
      public class SpawnEntitiesSystem : SystemBase {
          private int2 _entitySpacing;
  
          protected override void OnStartRunning() {
              var entitySpawnData = GetSingleton&lt;EntitySpawnData&gt;();
              var gridSize = entitySpawnData.SpawnGrid;
              _entitySpacing = entitySpawnData.EntitySpacing;
  
              for (int x = 0; x &lt; gridSize.x; x++) {
                  for (int y = 0; y &lt; gridSize.y; y++) {
                      var newEntity = EntityManager.Instantiate(entitySpawnData.EntityPrefab);
  
                      var newPosition = new LocalToWorld { Value = CalculateTransform(x, y) };
  
                      EntityManager.SetComponentData(newEntity, newPosition);
                  }
              }
          }
  
          private float4x4 CalculateTransform(int x, int y) {
              return float4x4.Translate(new float3 {
                  x = x * _entitySpacing.x,
                  y = 1f,
                  z = y * _entitySpacing.y
              });
          }
  
          protected override void OnUpdate() {}
      }
  }
  </code></pre>
  <p><strong>EntitySpawnData</strong></p>
  <pre><code>using Unity.Entities;
  using Unity.Mathematics;
  
  [GenerateAuthoringComponent]
  public struct EntitySpawnData : IComponentData {
      public Entity EntityPrefab;
      public int2 SpawnGrid;
      public int2 EntitySpacing;
  }
  </code></pre>
  <p><strong>Edit:</strong>
  I tried around a bit more and found out that it seems that the correct position will be set correctly at first. But it will instantly be overwritten by the prefabs Transform component. So maybe it has to do with converting the Prefab to an entity (I use the default Convert to Entity component) or a problem with some internal multithreading occurs.</p>