How to stop game freezing when doing large calculation? multi threading?

So i have a map generator that take a few seconds to generate and display. However, during these seconds the game completely freezes. Is there a way that i can do the calculation on a different thread and have the game not freeze when generating?
Any help is greatly appreciated! :slight_smile:

To multi-thread you can use Unity’s Job system.

(Unity - Scripting API: IJob)
_
https://docs.unity3d.com/Manual/JobSystemSchedulingJobs.html
_
and if you’re using jobs look into the burst compiler.
_
Burst User Guide | Package Manager UI website