Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

ITriggerEventsJob questions

Discussion in 'DOTS Physics' started by felipin, Dec 15, 2019.

  1. felipin

    felipin

    Joined:
    Nov 18, 2015
    Posts:
    48
    Is there any concept like "every TriggerEvent created from a PhysicsShape is processed at the same thread"? If I wanna change a component from my trigger entity, is there any safe way to do it?
     
  2. Ryuuguu

    Ryuuguu

    Joined:
    Apr 14, 2007
    Posts:
    337
    What I did was fill a hashmap <Entity,dataneededForChange> in the ITriggerEventsJob and then in a second job of type withEntityJob checked the hashMap[entity] and made the changes there. Since they were all SetComponentData I was able to this all in the second job on multiple threads.
     
unityunity