I want to instantiate a prefab inside a specific folder. But the problem is, instances are always created at root of project folder.
How can I instantiate a prefab inside a folder of my choice?
Thanks in advance
I want to instantiate a prefab inside a specific folder. But the problem is, instances are always created at root of project folder.
How can I instantiate a prefab inside a folder of my choice?
Thanks in advance
If you mean creating an asset in specific folder in your project then try this Unity - Scripting API: AssetDatabase.CreateAsset
IF you mean instantiating game object under some parent game object in Hierarchy then you have to get reference to not_yet_instantiated_game_object from Instantiate method and assign it’s parent, eg:
Transform myObject = Instantiate(prefab, Vector3.zero, Quaternion.identity) as Transform;
myObject.parent = transform;