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. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

ITriggerEventsJob questions

Discussion in 'DOTS Physics' 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:
    381
    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.