title: Unity DOTS Cubes don't want to move properly
body: <p>Hello i am currently learning DOTS but encountered a problem.
  I want to move some cubes but they don't want to. My System Script looks like this :</p>
  <pre><code>protected override JobHandle OnUpdate(JobHandle inputDeps)
  {
      var deltaTime = Time.DeltaTime;
      
      return Entities.WithName(&quot;Cube&quot;).ForEach((ref Translation position, in Scale scale) =&gt;
      {
              position.Value = NoisePosition(position.Value, deltaTime, scale.Value);
      }).Schedule(inputDeps);
  }
  </code></pre>
  <p>The noise position function calculates a new position dependant on the currently given one. The cubes move only once, then they stay at that position and won't move further. So i guess the system sets the cube position but does not change the initial value. So i start in state1, calculate state2 from it, the cubes get moved to state2 but in the next frame it calculates with state1 again. An example picture is linked here : <a href="https://ibb.co/kGqb3pP" rel="nofollow noreferrer">https://ibb.co/kGqb3pP</a> The initial y position of the cubes is always zero, so the calculation seems to work.</p>
  <p>I create the cubes with these lines :</p>
  <pre><code>var entity = entityManager.CreateEntity(cubeArchetype);
  entityManager.SetComponentData(entity, new LocalToWorld {
      Value = new float4x4(quaternion.identity, 
      new Vector3(x * scale, 0, y * scale)) 
  });
          
  entityManager.AddComponentData(entity, new Translation() {
      Value = new float3(x * scale, 0, y * scale)});
  entityManager.AddComponentData(entity, new Scale() { Value = scale });
  entityManager.AddComponentData(entity, new WorldRenderBounds());
  entityManager.AddSharedComponentData(entity, cubeRenderMesh);
  entityManager.SetName(entity, &quot;Cube&quot;); 
  </code></pre>
  <p>To the movement code : I use the same function for a comparison approach with the standalone jobsystem. Since it works there the logic should be right:</p>
  <pre><code>Vector3 NoisePosition(Vector3 position, float time, float scale)
  { 
      float Noise(float x, float y) 
      { 
          var pos = math.float2(x, y); 
          return noise.snoise(pos); 
      }
      
      var noiseValue = Noise(
          position.x * (RandomHeigtParameters.waveSize * scale) +         
          RandomHeigtParameters.offsetSpeed * time,
          position.z * (RandomHeigtParameters.waveSize * scale) +
          RandomHeigtParameters.offsetSpeed * time);
      return new Vector3(position.x, noiseValue * 
          RandomHeigtParameters.height + RandomHeigtParameters.waveSize,
          position.z);
  }
  </code></pre>
  <p>But if i replace the function call to a simple <code>position.Value += deltaTime</code> the cubes move correctly.</p>
  <p>So to wrap it up, i am a bit confused and would apprechiate if anyone here knows enough about DOTS to help me out. Thanks in advance.</p>