Before I rant, did I overlook anything?
Getting input:
var lookVector = new float2(MyInput.actions.Main.Look.ReadValue<Vector2>());
jobHandle = Entities.ForEach((ref LookInput lookInput) =>
{
lookInput.Vector = lookVector;
}).WithName("LookInput").Schedule(jobHandle);
Applying rotation:
var rotations = GetComponentDataFromEntity<Rotation>(false);
handle = Entities.ForEach((ref Rotation rotation, in LookRotation lookRotation, in LookInput input) =>
{
rotation.Value = math.mul(rotation.Value, quaternion.Euler(-input.Vector.y * lookRotation.Rate * deltaTime, 0f, 0f));
rotations[lookRotation.YawEntity] = new Rotation
{
Value = math.mul(rotations[lookRotation.YawEntity].Value, quaternion.Euler(0f, input.Vector.x * lookRotation.Rate * deltaTime, 0f))
};
}).WithName("Look").WithNativeDisableContainerSafetyRestriction(rotations).Schedule(handle);
I am polling and applying deltaTime.
This system update is supposed to be at the same rate as normal Update, so it’s supposed to work.
EDIT: I’ll try to move delta time to the moment the input is taken.
EDIT: That didn’t help and the delta time is confirmed consistent between those systems.
EDIT: I’ll compare Unity.Core.Time.DeltaTime and UnityEngine.Time.deltaTime; Yes, it is consistent.