Hi folks,
I have a very weird problem.
I have a system that does ForEach
. I have many systems of those and they are all working fine.
Now in my new system, I do something with the data and want to write back to the components and for some reason, for one out of the three, this doesn’t work.
The component struct looks the same as my working component structs. The system doesn’t show any errors.
Did anyone come across such a problem?
I have done many things:
- created a new testComponent struct.
- shortened the inputs.
- changed the type of variables/fields.
- manually wrote values into the code, without the calculations, like this:
entityComponent.zz = EntityComponent.Id; // Works
entityComponent.yy = EntityComponent.Id;// Works
entityComponent.xx = EntityComponent.Id;// Works
entityComponent.Runs = EntityComponent.Id;// Works
entitySpeed.Speed = EntityComponent.Id;// Works
entityDetails.zy = 1f;// Doesn't work
entityDetails.xz = 2f;// Doesn't work
entityDetails.speed = 3f;// Doesn't work
entityDetails.duration = 9f;//Doesn't work
- restarted Unity.
Here is the component struct:
using Unity.Entities;
public struct DetailsComponent : IComponentData
{
public float zy;
public float xz;
public float speed;
public float duration;
}
Anyone has an idea, please? Have been losing hours on this now…
Thanks,
Slarti