Search Unity

Does Unity no longer give errors about functions needing to be on the main thread?

Discussion in 'Editor & General Support' started by Dreamback, Apr 20, 2020.

  1. Dreamback

    Dreamback

    Joined:
    Jul 29, 2016
    Posts:
    220
    I've been stuck for a couple days on an error where a callback setting transform.position was being called, but transform.position wasn't being changed. I finally figured it out, the callback is called from a different thread, and of course transform is a property that does GetComponent, when all Unity functions must be called on the main thread only.

    It used to be that you would get an error in this situation when it happened, but I'm getting no errors at all, it just wasn't working. Has Unity removed the main-thread errors from Unity properties? An error message would have saved a couple days of frustration.
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,909
    Yeah I've helped people in a few threads on this forum with similar issues and frustratingly what they're all seeing on recent Unity versions seems to be the unceremonious death of the background thread with no errors or logs of any kind in the console. If you can come up with a project that reproduces this consistently I think it would be worth a bug report.
     
    Last edited: Apr 20, 2020
    Joe-Censored likes this.