- Home /
Instantiate a GameObject from a Prefab without using an original to clone
Hi. I need to instantiate a game object from a prefab without the original prefab to clone. I want something that goes like:
Instantiate("prefabname");
This is supposed to go in runtime. Is this possible? I've heard of asset loading (i.e. using Resources.Load() or URLs) but I don't want to use any of those. Thanks in advance! :D
Answer by Piflik · Jul 30, 2012 at 06:55 AM
Without an existing prefab, or without a prefab in the scene? The latter is easily achieved by adding a GameObject variable to the script and dragging the prefab in there.
Yeah, I realized that I had to make at least a pointer reference to the prefab. Thanks! :D
Your answer
Follow this Question
Related Questions
How to add an asset to a script-enabled public game object? 1 Answer
GameObject change Position after game started 1 Answer
prefab is instantiating without a script 2 Answers
PlayerRespawn class wont Instantiate the player prefab 1 Answer
Is it possible to disable/enable game-object inside Instantiate PreFab c# 0 Answers