Search Unity

Question Queries hit triggers can only be called from the main thread

Discussion in 'Physics' started by SalahChafai160, Jun 19, 2021.

Thread Status:
Not open for further replies.
  1. SalahChafai160

    SalahChafai160

    Joined:
    Dec 29, 2018
    Posts:
    8
    hello folks,
    this is my first time working with unity's job system so I might be missing something obvious but here's my situation, I have a job that calls a CalculateColliders() function in another script in which I do a simple overlapcircle check
    Code (CSharp):
    1. Physics2D.OverlapCircleAll(WorldPosition, tileDiameter, ObstaclesLayer);
    however once I play I get this error
    Code (CSharp):
    1. get_queriesHitTriggers can only be called from the main thread
    I know that means I should only call overlapcircle from the main thread but I need to call it this way, so is there a fix or a workaround?
     
  2. DongJL

    DongJL

    Joined:
    Jul 15, 2020
    Posts:
    3
  3. DongJL

    DongJL

    Joined:
    Jul 15, 2020
    Posts:
    3
    did you solve it?
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,419
    These physics queries can only be called from the main-thread. There is no "solving" it. ;)

    Also, please don't necropost on these forums by bumping and then posting separately. It's not a chat-room and you can edit your threads.

    Thanks.
     
Thread Status:
Not open for further replies.