How do I avoid Unity Freeze with the Instantiate method?

Debug it by attaching a debugger and step through it. A “freeze” is likely because you’re doing something on the main thread that never exits. This is different than a “crash” which gives you a crash bug report.

For instance, if you were to create a prefab that intantiated itself on start. You instantiate the prefab which instantiates a prefab which instantiates a prefab etc. Or a for loop which never exits etc.

NOTE: It’s minor here but please used code-tags when posting code.