-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_transform can only be called from the main thread. #10
Comments
Yes, the callback is running in a background thread, so not operate the UI in that. Instead, put the data in a variable, the use the main thread to read the variable then operate the UI. See the example: |
@floatinghotpot can you please update the lib to support the script that i'm doing? |
I think that is same, the callback is a background thread, you can write log, but you cannot access UI. |
@floatinghotpot i'm not accessing UI, i'm accessing player gameobject transform |
But your suggestion is good. If initialize a function in main thread to regularly check the queue then call your callback, it should be okay. |
yeah and that should be a core element on the lib |
I think that is not difficult, just add a wrapper. I will try. |
@floatinghotpot thankyou so much sir :) |
what's the best practice to set something like transform inside On event
i'm not really experienced with multithreading, from the example all i can found is "lock" which i'm not sure what to put inside
i'm using fpanettieri's before using this, and i can do above script
The text was updated successfully, but these errors were encountered: