Quantcast
Channel: Latest Questions by Tanoshimi2000
Viewing all articles
Browse latest Browse all 91

Create GameObjects in Threads?

$
0
0
So I have a class I'm using in Editor to make a collection of GameObjects. It takes a long time, and there's no update in between items, so it freezes until all items are made. Wanting to speed this up, I moved the code to a separate class, and called that on a thread, but when I run it, I get an error: Internal_CreateGameObject can only be called from the main thread. Constructors and field initializers will be executed from the loading thread when loading a scene. Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function. I'm wondering if there's either a) a means to create these objects in a thread b) a means to update my GUI on the status between GameObject Creations (I've looked at Coroutine but didn't quite get it. c) Application.DoEvents for those familiar with VB.Net.

Viewing all articles
Browse latest Browse all 91

Latest Images

Trending Articles



Latest Images