speckleworks / SpeckleUnity

Stream live 3D data into Unity with the open data platform for BIM - Speckle!
https://speckleworks.github.io/SpeckleUnity/
MIT License
14 stars 5 forks source link

Coroutines can't be started from within the call stack of an event response #27

Closed pablothedolphin closed 4 years ago

pablothedolphin commented 4 years ago

Super weird bug that has a pretty ugly work around for it using update, a Boolean and a string.

Need to investigate what the issue really is and likely file a bug report to unity or just fix it.

pablothedolphin commented 4 years ago

This is because web socket messages are processed on a different thread and coroutines can only be called from the main thread. Strange why this doesn't throw an error in the console though. Need to confirm this before closing the issue.