Search Unity

Bug Jobs with only in component parameters are not getting executed unless data changes

Discussion in 'Entity Component System' started by Knedlo, Jan 28, 2023.

  1. Knedlo

    Knedlo

    Joined:
    Oct 15, 2012
    Posts:
    54
    I have just spent a few hours trying to figure out why is my IJobEntity job almost never executed and I found out, that unless you give it at least one ref parameter, it behaves like it has a change filter. My use case is a debug draw job, that takes some data from components and draws things. It doesn't need to change any data but has to run every frame. I reproduced this issue with IJobEntity and foreach SystemAPI.Query<T>. Both won't run unless there's a change.

    I couldn't find any annotation that would make the job run without changing one of the parameters from in to ref. I believe that default behavior should be the opposite and there should be some way to make job run only when data changes.

    If there's a way to force execute a job, I'd appreciate a piece of advice.

    Tested on 2022.2.3f1 with Entities 1.0.0-pre15

    Cheers
     
    Last edited: Jan 29, 2023