- Home /
Instantiate prefab in editor
Hi,
I need to create/instantiate prefab in editor. I know you can use [ExecuteInEditMode] and then just Instantiate(), but that will create copy of the prefab. So when I change the prefab, this object will not change accordingly.
Imagine you are building many levels, and you place objects into scene in edit mode via code, not just by dragging prefabs into scene.
How can I spawn prefabs in code in edit mode? (So actually spawned object is blue as prefab, not prefab clone as: name(Clone))
Thanks for any help, really.
Answer by Wrymnn · Jul 30, 2015 at 09:01 AM
I think that
PrefabUtility.InstantiatePrefab(object);
is what I`m looking for.
Your answer
Follow this Question
Related Questions
Checking if object intersects? 1 Answer
Instantiate Problem 2 Answers
Add Item to GridLayoutGroup using Instantiate 3 Answers
Get unity to recognize prefab in C# 2 Answers
How do you access a photonNetwork.Instantiate Object 2 Answers