- Home /
How to use MultiThreading to remove momentary unresponsiveness
Hello. The title speaks for itself. my Unity goes unresponsive when I import an .obj file. The Editor and the built version goes unresponsive but its actually just loading the .obj. What can I do to stop/prevent it from going unresponsive. I've read a lot of Multithreading and I think this is what I'm looking for.. the problem is.. its way too advance and all of the tutorials, videos I've seen have their own distinct/different way of making their own multithread script. so I can't keep up and follow 1 of them.
https://www.dropbox.com/s/bt3e4qbzvkcxcex/BackupOBJImporter.rar?dl=0
here's my app. basically this is an OBJ importer which you can also change the position, rotation, scale AND change the material color and material shader of the imported obj at runtime. and you can save all the data. but since runtime importation doesn't really save the obj as a prefab or save it in a resource folder at runtime or leave it at runtime or etc. .. so when you want to load you have to close the app, paste the url again and then press load..
for OBJ Importation I'm using this https://www.assetstore.unity3d.com/en/#!/content/49547 the script that needs threading is the OBJLoader.cs
here's a demo on how to save.
and then after saving I close the app and play it again or if you're using the editor unplay the editor and then play it again and paste the url again.. and then press load.
demo of load
so again the loading of the obj is my problem.. it goes unresponsive.
by the way the url needs to be all forward slash.. so if the model i added is in here for example.
C:\Users\rhylvin2016\Desktop\Build\BackupOBJImporter\Models\Lamborghini
you just need to change all backslash to forward slash and add Avent.obj
like so
C:/Users/rhylvin2016/Desktop/Build/BackupOBJImporter/Models/Lamborghini/Avent.obj
you'll also notice I wrote "Body" as Material Name. it is the name of the materials that are changed and are edited. so just try to use that one as well.
P.S. I'm using XML to save and load.. the xml file can be found in Assets -> StreamingAssets -> XML -> item_data.xml
hey sir @Bunny83 I've read your answer to this. http://answers.unity3d.com/questions/357033/unity3d-and-c-coroutines-vs-threading.html really hope you could help me with it. please and thank you sir.
Your answer
Follow this Question
Related Questions
MonoBehaviour.Invoke and Threading 2 Answers
Multithreading freezes editor 1 Answer
Getting current time from the worker thread 1 Answer
Threaded procedural animation 0 Answers