Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

ITriggerEventsJob questions

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

  1. felipin

    felipin

    Joined:
    Nov 18, 2015
    Posts:
    49
    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:
    387
    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.