Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Should SteeringSystem in Asteroids Sample be using NativeThreadIndex?

Discussion in 'NetCode for ECS' started by adammpolak, Jun 5, 2022.

  1. adammpolak

    adammpolak

    Joined:
    Sep 9, 2018
    Posts:
    450
    https://github.com/Unity-Technologi...les/Asteroids/Mixed/Systems/SteeringSystem.cs

    Code (CSharp):
    1.             Entities.WithReadOnly(inputFromEntity).WithAll<ShipTagComponentData, ShipCommandData>().
    2.                 ForEach((Entity entity, int nativeThreadIndex, ref Translation position, ref Rotation rotation,
    3.                 ref Velocity velocity, ref ShipStateComponentData state,
    4.                 in GhostOwnerComponent ghostOwner, in PredictedGhostComponent prediction) =>
    Should it not be entityInQueryIndex?
     
  2. timjohansson

    timjohansson

    Unity Technologies

    Joined:
    Jul 13, 2016
    Posts:
    473
    You are correct, it should not be using nativeThreadIndex for the command buffer sort key, it should be entityInQueryIndex