Answer the question
In order to leave comments, you need to log in
What's the best way to load prefabs in Unity?
I need to load different prefabs in the scene depending on randomness and save. Google turned out only Resources.Load, but came across hints that it is better not to use it. And if you still use it, then in what place and will the scene loading process be correctly displayed then?
Answer the question
In order to leave comments, you need to log in
There are no problems using Resources.Load. Unless you need to put the resources used in the Resources folder, as far as I remember.
Load whatever you need before loading the scene and use the resulting resources however you like.
void Awake(){
var MyObj = Resources.Load("Prefabs/MyPrefab.prefab");
Instantiate(myObj, Vector3.zero);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question