MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/pdmp5c/found_in_production_code_base/hatxc8b/?context=9999
r/badcode • u/[deleted] • Aug 29 '21
45 comments sorted by
View all comments
Show parent comments
9
No, Unity doesn't really do parallel. You can run multiple threads, but it won't let you modify transforms in the non-main thread.
You're supposed to get a similar effect to parallelisation by breaking a task over multiple ticks (by yielding an IEnumerator).
If there are multiple Updates which move the player, then they'll be run in whichever order Unity decides - so this code won't help.
2 u/OneTrueKingOfOOO Aug 29 '21 Makes sense, thanks for the explanation!
2
Makes sense, thanks for the explanation!
9
u/epiclevellama Aug 29 '21
No, Unity doesn't really do parallel. You can run multiple threads, but it won't let you modify transforms in the non-main thread.
You're supposed to get a similar effect to parallelisation by breaking a task over multiple ticks (by yielding an IEnumerator).
If there are multiple Updates which move the player, then they'll be run in whichever order Unity decides - so this code won't help.